At 10:45 04-08-07 +0800, you wrote:
>N. Coesel wrote:
>> At 16:36 03-08-07 +0200, you wrote:
>>   
>>> Hello,
>>>
>>> I am working with the Msp430 compiler for cygwin
>>> mspgcc-20070216.exe
>>> gcc version 3.2.3
>>>
>>> Does the sprintf support long longs. In mine test program it doesn't 
>>> seem to work.
>>> Am i doing something wrong ?
>>>     
>>
>> I've noticed similar behaviour on other platform. Consider long long
>> support in gcc 3.x as not working. Using long long may result in odd
>> behaviour (wrong result) and/or compiler crashes.
>>
>> Nico Coesel
>>   
>I use long long int (well, I actually use int64_t) quite a bit 
>withmspgcc, and I haven't had any trouble. I've never used printf with 
>mspgcc, so I don't know about that part, but 64 bit arithmetic seems OK.
>
>Steve

Consider yourself lucky :-) Beware some change somewhere in the code may
break the long long operations. I've experienced weird compiler crashes
while using long long operations. However, when I tried to isolate the
problem by moving the function which caused the problem to a new source
file, it compiled without any problems. On the 386 platform an operation
like a= b + c*d; resulted in odd behaviour while using gcc 3.x. While
e=c*d; a=b+e; worked fine.

I suspect gcc3.x has a stack of buffer overflow which is triggered by long
long operations in combination with the surrounding code.

Nico Coesel


Reply via email to