I've noticed the compiler does not report un-used but declared variables like it used to.
The only ones it has reported in the message window now are ones defined in a 'sub procedure's' label declaration that never gets actually used.
Is this by design, or a bug?
Thanks again for your attention, Mhz.
(MikroBasic Pro V4.0 Beta)
Compilier doesn't report un-used variables
Compilier doesn't report un-used variables
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|
SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|
SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|
Re: Compilier doesn't report un-used variables
Yes, this has already been reported or asked but answer was : Compiler remove automatically unused variables.
Yes, I know, this is not enough, because if you want to clean your code from unused variable you need to know which one are not used.
It's quite a shame because old MB version did that.
Yes, I know, this is not enough, because if you want to clean your code from unused variable you need to know which one are not used.
It's quite a shame because old MB version did that.
Alain
- ranko.rankovic
- Posts: 433
- Joined: 11 Jun 2010 09:22
Re: Compilier doesn't report un-used variables
Hello Megahurts and Kalain,
I was adding some variables that are not used in program it self, and compiler did remove them. Can you please create a little project that will demonstrate not removed variables?
Best regards
I was adding some variables that are not used in program it self, and compiler did remove them. Can you please create a little project that will demonstrate not removed variables?
Best regards
Ranko Rankovic
mikroElektronika [Support Department]
mikroElektronika [Support Department]
Re: Compilier doesn't report un-used variables
The problem is not from compiler which I assume remove un used variables at compilation.ranko.rankovic wrote:Hello Megahurts and Kalain,
I was adding some variables that are not used in program it self, and compiler did remove them. Can you please create a little project that will demonstrate not removed variables?
Best regards
Even if this variable is removed from comilation, this (un used) variable is still there in program declaration.
So, if compiler do not display or report unused variable, it's not easy for user to remove such variables among let's say 50 variables and few thousands of code of lines.
This report is usefull when you want to clean code from a program you started long time ago from an messy idea.
Alain
- ranko.rankovic
- Posts: 433
- Joined: 11 Jun 2010 09:22
Re: Compilier doesn't report un-used variables
Hello Kalain,
Thanks for pointing this out. Will proceed to our developers to implement this option in our compilers.
Best regards
Thanks for pointing this out. Will proceed to our developers to implement this option in our compilers.
Best regards
Ranko Rankovic
mikroElektronika [Support Department]
mikroElektronika [Support Department]
Re: Compilier doesn't report un-used variables
This feature was implemented in previous MB compiler. (May be a bit before 2.50)ranko.rankovic wrote:Hello Kalain,
Thanks for pointing this out. Will proceed to our developers to implement this option in our compilers.
User could choose to report or not this feature in Message windows.
A bit like shown below.
Alain
Re: Compilier doesn't report un-used variables
Hey Kalain,
You're exactly right, I forgot about that feature totally! Would love to have it back again.
So I second the motion. lol
My current project is over 26K Bytes of ROM used and around 6K lines of BASIC code and I keep running my laser printer out of toner trying to keep the "top of the programs" periodic changes current for referencing to while digging a hole out through the bottom of my monitor it seems, lmho, because I expect to hit 40k - 50K when done. (I hope )
Mhz.
You're exactly right, I forgot about that feature totally! Would love to have it back again.
So I second the motion. lol
My current project is over 26K Bytes of ROM used and around 6K lines of BASIC code and I keep running my laser printer out of toner trying to keep the "top of the programs" periodic changes current for referencing to while digging a hole out through the bottom of my monitor it seems, lmho, because I expect to hit 40k - 50K when done. (I hope )
Mhz.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|
SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|
SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|
Re: Compilier doesn't report un-used variables
Bump. Still missing this feature. I'm working on a program for PIC32 with about 2600 lines of Pascal and 45k of flash, and I would really like to clear all the dead branches out. It's not that I'm concerned about the space used, it's just that I'd like to get the schmutz out of the listing.
If you know what you're doing, you're not learning anything.
Re: Compilier doesn't report un-used variables
Yep, I agree.LGR wrote:Bump. Still missing this feature. I'm working on a program for PIC32 with about 2600 lines of Pascal and 45k of flash, and I would really like to clear all the dead branches out. It's not that I'm concerned about the space used, it's just that I'd like to get the schmutz out of the listing.
From what I have suggested (more than one year ago), I would like to extend the request at : "Non used code" instead of just "Non used Variables".
In my hobby project (over 7000 lines), as I do not work on it every weeks, after a year I do not remember which variables or even procedures are really used or not in my code.
Would be nice to point this after a compilation in order to clean the "schmutz".
Alain
Re: Compilier doesn't report un-used variables
Yep, I agree.LGR wrote:Bump. Still missing this feature. I'm working on a program for PIC32 with about 2600 lines of Pascal and 45k of flash, and I would really like to clear all the dead branches out. It's not that I'm concerned about the space used, it's just that I'd like to get the schmutz out of the listing.
From what has been suggested (more than one year ago), I would like to extend the request at : "Non used code" instead of just "Non used Variables".
In my hobby project (over 7000 lines), as I do not work on it every weeks, after a year I do not remember which variables or even procedures are really used or not in my code.
Would be nice to point this after a compilation in order to clean the "schmutz".
Alain
Re: Compilier doesn't report un-used variables
Agreed. Constants, variables, procedures. Either list the unused ones, or have an option to automatically delete them. Call it the "schmutz" tool.
=====================
That's one of a number of Yiddish words that's become incorporated into American English. It fits perfectly.
=====================
That's one of a number of Yiddish words that's become incorporated into American English. It fits perfectly.
If you know what you're doing, you're not learning anything.
Re: Compilier doesn't report un-used variables
I'd like to re-enforce the request for this feature to be implemented again please mE guys.
What will it take to get it done? A majority vote?
Seriously, anybody who has done any fairly large programs can see how useful a tool like this would be,
you guys had to also, as it was in the early versions. Why drop it?
I'm sure any name you put on it will be acceptable also
Regards, Mhz.
What will it take to get it done? A majority vote?
Seriously, anybody who has done any fairly large programs can see how useful a tool like this would be,
you guys had to also, as it was in the early versions. Why drop it?
I'm sure any name you put on it will be acceptable also
Regards, Mhz.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|
SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|
SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|
Re: Compilier doesn't report un-used variables
Hi,
I have notified our developers regarding this, and they have it on their mind.
Regards,
Filip.
I have notified our developers regarding this, and they have it on their mind.
Regards,
Filip.