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: David A. Wheeler
Subject: Re: [Tinycc-devel] Bug Report (offset+cast)
Date: Fri, 11 May 2007 11:31:28 -0400 (EDT)

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




reply via email to

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