[Tinyos-help] AVR GCC compiler problems
Philip Levis
pal at cs.stanford.edu
Wed Feb 27 13:36:48 PST 2008
On Feb 27, 2008, at 12:11 PM, José Moyano wrote:
> Yes, you are right. If so many people is using this compiler, must
> be my error. I try hardcoding, and the error continues. Maybe an
> optimization problem? I'm using -o0 (no optimization).
That would still be a compiler problem.
>
> One more thing: Does C support coercion? Theoretically, I don't
> need casting for my example. Or, at least, the compiler must throw
> a warning or something. Do you use casting for all your 32-bit
> statements?
On microcontrollers, the int type is often 16 bits, not 32 bits. So
you need coercion.
> I've used casting for the comparison (mask != CAN_DEFAULT_MASK) but
> the error continues.
> Another clue: The error happens only when there are few sentences
> betweens two (or more) calls to the routine. If I wait some time
> for the second call, it works fine. However, as you can see in the
> code, the routine doesn't need clock cycles to be called again.
Two steps:
1) Take a look at app.c
2) Take a look at the assembly
There have been compiler bugs in the past, but as far as I recall
they've all been on msp430-gcc.
Phil
More information about the Tinyos-help
mailing list