[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] global variables
From: |
Curtis Maloney |
Subject: |
Re: [avr-gcc-list] global variables |
Date: |
Mon, 22 Aug 2005 09:43:49 +1000 |
User-agent: |
Debian Thunderbird 1.0.6 (X11/20050802) |
Tomas Krcka wrote:
Hi!
I have a problem with global variables in my project.
The problem is:
I'm not sure why you felt the need to post this 3 times, but...
I have file system.c
byte proc_tbl[MAX_PROCESS]; //it's global variable in system.c
void System_Init(void){
int i;
for (i = 0;i < MAX_PROCESS; i++)
proc_tbl[i] = NOT_USED;
}
I'm going to assume you have something like "typedef unsigned char byte;"
somewhere.
What's more important is what is "NOT_USED" defined as?
If it's outside the range of a byte you'll never get a true on the comparison.
If you don't have the right -W switches passed to the compiler, it won't warn
you about them, either.
--
Curtis Maloney