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
Posted: Tue Jun 19, 2007 11:50 am
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.
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