[Top][All Lists]

[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 (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.

Happens here too. However,

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

Confirmed, that one works correctly.

--- David A. Wheeler

Tinycc-devel mailing list

reply via email to

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