|
From: <zh...@cm...> - 2005-06-16 23:09:25
|
What does "Initializer element is not constant" mean?
I got this error when compiling C51 program.
# make main.rel
sdcc -mmcs51 --stack-auto --use-stdout --code-size 32768 --iram-size 512 --xram-size 65536 -I/usr/share/sdcc/include -Iincludes -D_DEBUG -DSDCC --model-large -I/usr/share/sdcc/include -Iincludes -c main.c -o main.rel
main.c:513: warning 112: function 'rand' implicit declaration
main.c:513: warning 84: 'auto' variable 'rand' may be used before initialization
main.c:103: error 2: Initializer element is not constant
make: *** [main.rel] Error 1
The code is:
unsigned int signaltime=0;
void timer0() interrupt 1 using 1
{
TH0=0x4c;
TL0=0x23;
bgtime++;
signaltime++; // This line causes error
freqtime++;
querytime++;
scantime++;
}
The most strange is, SDCC reports error even I comment out this line or the whole function.
Any ideas?
|