|
From: | Georg-Johann Lay |
Subject: | Re: [avr-gcc-list] odd behaviour with type casting |
Date: | Fri, 24 Feb 2012 00:42:34 +0100 |
User-agent: | Mozilla Thunderbird 1.0.7 (Windows/20050923) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |