[Top][All Lists]
[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
- [Tinycc-devel] Bug Report (offset+cast), Gil Dabah, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), kf, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast),
David A. Wheeler <=
- Re: [Tinycc-devel] Bug Report (offset+cast), Gil Dabah, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), Dave Dodge, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), kf, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), Gil Dabah, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), David A. Wheeler, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), Dave Dodge, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), Rob Landley, 2007/05/11
- Re: [Tinycc-devel] Bug Report (offset+cast), Dave Dodge, 2007/05/12
- Re: [Tinycc-devel] Bug Report (offset+cast), Rob Landley, 2007/05/12
- Re: [Tinycc-devel] Bug Report (offset+cast), Rob Landley, 2007/05/11