CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Difference between COMPILE and BUILD ALL

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

Difference between COMPILE and BUILD ALL
PostPosted: Thu Oct 24, 2013 7:31 pm     Reply with quote

Version: 4.137

I know this might sound like a silly question to some but hey, I can't know everything! ;)

I am seeing some very strange behavior that I just don't understand.

First-off, I just hit the "COMPILE UNIT F9" button four times in a row and in all four times, I never got the same end-result splash screen:

First compile:
RAM: 61%
ROM: 64%

Second compile:
RAM: 51%
ROM: 63%

Third compile:
RAM: 41%
ROM: 63%

Fourth compile:
RAM: 65%
ROM: 63%

I mean, I just hit COMPILE, then when it's done, I hit COMPILE, then I hit COMPILE again and the RAM percentage jumps all over the place. The reason I am doing this is because I got to this situation where I hit COMPILE and got a "not enough RAM for all variables". So I started clearing some code and suddenly compiled and got like 83% RAM usage which did not make sense because I had just cleared-up some unused strings and stuff... Then I hit recompile and got like 87%. Then recompile and it changes everytime. Why??

Second question: what's the difference between COMPILE and the BUILD ALL button (blue-red-yellow squares in a triangular fashion)? Which one should I use?

Thanks,

Ben
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Thu Oct 24, 2013 11:34 pm     Reply with quote

What it is meant to do....

'Build all', forces _everything_ to recompile.
'Compile', only rebuilds stuff where the source file has changed.

This is a 'standard' for compilers, _but_ on your version (and most pre V5 versions), compile runs, even if nothing has changed.

Now generally it shouldn't make very much difference, unless you are using linked modules, in a larger project, where only recompiling the stuff that has changed will be significantly quicker. However occasionally enough will have changed that it is worth forcing everything to compile.

Your 'different each time' behaviour is certainly not normal. Multiple calls shouldn't make anything different happen. I've only seen things like this happen, when another program was 'touching' the source files.

"I had just cleared-up some unused strings and stuff". Strings unless declared as 'const', are copied into RAM when the code starts, so tidying a few strings that are not used, will save a lot of RAM. If 'const', they will also be copied to RAM, if you have the option 'PASS_STRINGS=IN_RAM", but not automatically till used.

The different compilation may be specific to your compiler version, and chip (haven't got this one to test here). If there is no significant time difference on your project, then 'build all' should force a full recompile.

Best Wishes
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Mon Nov 04, 2013 7:16 am     Reply with quote

Ok, another weird thing I just noticed: I commented-out several hundred lines of code. When I compile, it STILL tells me that I don't have enough RAM for all variables AND it still tells me I have 10899 lines of code. And if I uncomment the lines of code, it still tells me I have 10899 lines.

I mean, the lines are literally commented-out by chunks using /* */ so I don't see how the compiler sees them. I should compile and have like 10600 lines or something.

Any idea?
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Mon Nov 04, 2013 8:15 am     Reply with quote

The 'count' is just the number of lines. It still has to look at them, to 'know' that the comment hasn't ended, so they are counted. Exactly the same happens in Microsoft VC.

Best Wishes
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Mon Nov 04, 2013 8:28 am     Reply with quote

Hmmm... well if that was true, then removing a single comment line should bring the count down by one. It doesn't. I actually removed three lines of comments bumping my code up in the page and it still counts 10899 lines.... unless I don't understand your explanation.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group