Hello!

I've been ripping my hair out for a couple of hours in a large project which conks out spectacularly. I've isolated the problem in a small test case:

void testarray(void) { static uint8_t array[32]; uint8_t i; for(i=0;i<32;i++) array[i]=i; for(i=0;i<32;i++) { bbprint("array["); bbprintdec(i); bbprint("]="); bbprintdec(array[i]); bbprint("\n"); } }

Which produces:

array[0]=0 array[1]=1 array[2]=2 array[3]=3 array[4]=4 array[5]=5 array[6]=6 array[7]=7 array[8]=8 array[9]=9 array[10]=0 array[11]=161 array[12]=0 array[13]=3 array[14]=0 array[15]=161 array[16]=2 array[17]=52 array[18]=0 array[19]=174 array[20]=0 array[21]=21 array[22]=2 array[23]=172 array[24]=24 array[25]=25 array[26]=26 array[27]=27 array[28]=28 array[29]=29 array[30]=30 array[31]=31

If I make the array global I get the {0..31} expected result.

This is with avr-gcc 4.4.4. Could there be a problem with it or am I doing something wrong?

Does this ring a bell with anyone?

Thanks in advance.