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

Global variables with multiple compilation units
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lakata



Joined: 13 Oct 2010
Posts: 1

View user's profile Send private message

PostPosted: Wed Oct 13, 2010 2:05 pm     Reply with quote

I've had the same problem, and I'm sure it is a compiler/linker bug, and given CCS's track history in being unable to do "multiple unit compilation", it doesn't surprise me.

One way you know that you are screwed is to look at the symbol table in the final output file (*.SYM). Look down the list and see if (a) there are an duplicate global symbols (which is bug #1) and see if (b) any of the symbols overlap in memory space (which is bug #2). I had a particular global variable (a struct) that was found 2 places in the memory space. One of the positions was totally bogus, and overlapped other global variables, causing my problem to have *real* problems.

The solution is to give up on multiple unit compilations, and create just one source file that includes all of your other source files. Doing this seemed to finally work for me.

CCS is a toy compiler that is only suitable for hobbyists that need to make a LED blink, but it is not suitable for a professional firmware developer. I would not be using it, except for the fact that the customer required me to use it. CCS has the perfect solution for keeping their customers wedded to their compiler, because you can't port your CCS C-like-code to other C-compilers without a world of hurt.
newguy



Joined: 24 Jun 2004
Posts: 1946

View user's profile Send private message

PostPosted: Wed Oct 13, 2010 4:38 pm     Reply with quote

lakata wrote:
CCS is a toy compiler that is only suitable for hobbyists that need to make a LED blink, but it is not suitable for a professional firmware developer.


I have several products in the field developed with the CCS compiler. I know others here do too. It's definitely not a "toy" compiler. It does have its idiosyncrasies, but's it's not a toy.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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