Paul Thomas schrieb:
I'm getting very wrong math in one instance using a casting, negative numbers and a division. If I don't do any 1 of those three things it works fine. This is with an atxmega32a4 using both the atmel avr-gcc 4.5.1 (avr-gcc (AVR_8_bit_GNU_Toolchain_3.2.3_314) 4.5.1) as well as 4.5.1 gcc built with the script from AvrFreaks. The code snippet to demonstrate this is: ...
Without a minimal example that *compiles* and is legal C code no one will be able to say anything about this. Same for guessing the compiler options.
With almost 99.9% certainty your problem is somewhere else; not in the arithmetic and not in the cast.
4.5.x has PR46779 and PR39633 open, for example, but with obfuscated code there is no clue...
Johann _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list