tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Bug Report (offset+cast)


From: Gil Dabah
Subject: Re: [Tinycc-devel] Bug Report (offset+cast)
Date: Fri, 11 May 2007 19:05:58 +0300
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Ok I will change the code so it will work for TCC too.
BTW - Who can fix it and commit? Guess it's something in the parser...

I tried to mail Bellard myself, but no response.

David A. Wheeler wrote:
Gil Dabah:
It seems you can't cast a pointer from a specified offset:

char* s = "\x34\x34\x12";
short word = *(short*)&s[1]; // <--buggy
printf("%x", word);

will print 34 instead of 1234 (on LE machine, of course).

Confirmed, it's a bug in tcc.

kf:
Happens here too. However,

short word = *(short*)(s+1);
works as expected.

Confirmed, that one works correctly.

--- David A. Wheeler


_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]