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

4.0.25 compiler array allocation

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



Joined: 26 Feb 2007
Posts: 2

View user's profile Send private message

4.0.25 compiler array allocation
PostPosted: Tue Jun 19, 2007 5:00 am     Reply with quote

Hello,

I used ccs since several month, and I have a question about how it works within MPLAB IDE.

For my project I use different *.c files but only one is under the directory 'source files' in mplab all the others are in the directory 'others file'.

I defined different global variables in the different files.

I include these c files at the beginning of the main.c file (the only one in the source directory of ths mplab project).

should i declare my global variables as extern in all files ? because i observed some problem in the memory management and some global arrays were overwritten by local arrays.


thank you very much

Jean Michel LECONTE
barryg



Joined: 04 Dec 2006
Posts: 41

View user's profile Send private message

PostPosted: Tue Jun 19, 2007 11:50 am     Reply with quote

The manual has this to say about "extern":
Quote:
extern Is allowed as a qualifier however, has no effect.
So that is not going to fix anything. An important thing to check for is that variables (especially anything that's not an int) are declared before they appear in your code. It's important because it will cause "surprises" and because the compiler does not warn you about this.
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