> > The 2 first fields uses 1 byte with GCC/Clang while they use
> > sizeof(unsigned int) bytes with TCC. GCC/Clang pack the bit fields
> > on the smaller type available. So, sizeof(struct mystruct1) = 4 with
> > GCC/Clang and sizeof(struct mystruct1) = 8 with TCC.
>
> I tried your "bitfield.c" t
On Mon, Oct 22, 2012 at 09:38:22PM +0200, Didier Barvaux wrote:
> Please send your patch, it may be better than mine. Or maybe we can
> create a third patch from ours and mine.
By the way, ARM describes how to bit-fields should be laid out in
http://infocenter.arm.com/help/topic/com.arm.doc.ihi004
Didier Barvaux wrote:
On a structure such as:
struct mystruct1
{
unsigned int mystruct1_foo:4;
unsigned int mystruct1_bar:4;
uint8_t mystruct1_other;
uint16_t mystruct1_other2;
};
The 2 first fields uses 1 byte with GCC/Clang while they use
sizeof(unsigned int) bytes wi
> This was the very first patch that I ever wrote to tcc. Except I
> didn't make it optional. I never submitted it because of that.
>
> Being able to pack data the same way that GCC (and MSVC for that
> matter) does is very useful, especially in network code. Granted that
> "officially" I think t
0, 2012 3:59 PM
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] question about bit-fields
Didier Barvaux wrote:
> Please find attached, a patch that modify TCC so that it can pack bit
> fields the way GCC does. The mechanism is optional and off by default.
> It can be enabled with
Grischka,
> > Please find attached, a patch that modify TCC so that it can pack
> > bit fields the way GCC does. The mechanism is optional and off by
> > default. It can be enabled with the -fgcc-packing option.
>
> ... the way GCC does?
>
> > I added this mechanism because I want to use TCC to
Didier Barvaux wrote:
Please find attached, a patch that modify TCC so that it can pack bit
fields the way GCC does. The mechanism is optional and off by default.
It can be enabled with the -fgcc-packing option.
... the way GCC does?
I added this mechanism because I want to use TCC to compile
Hello all,
> > > If one changes anything at all then it only makes sense to change
> > > it so as to be layout compatible with GCC. A third layout (GCC,
> > > TCC-old, TCC-new) wouldn't help. Although the rules of GCC are
> > > relatively obscure and complex in corner cases.
> >
> > Actually I
Hi,
> > If one changes anything at all then it only makes sense to change
> > it so as to be layout compatible with GCC. A third layout (GCC,
> > TCC-old, TCC-new) wouldn't help. Although the rules of GCC are
> > relatively obscure and complex in corner cases.
>
> Actually I have to correct mys
Hi,
On Sun, 27 May 2012, Michael Matz wrote:
If one changes anything at all then it only makes sense to change it so
as to be layout compatible with GCC. A third layout (GCC, TCC-old,
TCC-new) wouldn't help. Although the rules of GCC are relatively
obscure and complex in corner cases.
Act
Alright. Sounds good. I'm in. :-)
Best regards,
Rick C. Hodgin
Original Message
From: Michael Matz
Sent: Sun, May 27, 2012 04:49 PM
To: tinycc-devel@nongnu.org
CC:
Subject: Re: [Tinycc-devel] question about bit-fields
>Hi,
>
>On Sun, 27 May 2012, Ric
Hi,
On Sun, 27 May 2012, Rick Hodgin wrote:
Didier,
You're able to take the code and modify that requirement. It seems
straight-forward enough that TinyCC is (in memory at compile-time)
determining the target size, regardless of the storage size, and using
that for the storage size in memo
ds).
Best regards,
Rick C. Hodgin
--- On Sun, 5/27/12, Didier Barvaux wrote:
> From: Didier Barvaux
> Subject: Re: [Tinycc-devel] question about bit-fields
> To: tinycc-devel@nongnu.org
> Date: Sunday, May 27, 2012, 7:47 AM
>
> > > Is there an option or a declaration
> > Is there an option or a declaration to make tcc compute the expected
> > length for unsigned-int-based bit fields?
>
> No, there isn't.
>
> AFAIK the C standard says this is implementation-defined.
> For portability don't use bitfields.
Thank for your answer. I see the problem. I added a ch
On Sun, May 27, 2012 at 11:12:39AM +0200, Didier Barvaux wrote:
> Is there an option or a declaration to make tcc compute the expected
> length for unsigned-int-based bit fields?
No, there isn't.
AFAIK the C standard says this is implementation-defined.
For portability don't use bitfields.
Dan
Hello all,
I'm trying to build my project with tcc (yesterday's git version). It
succeeds without any required change (cool!), but tests fail :(
I narrowed the problem to bit-fields, and more especially to the length
of some bit-fields. I created a small test program to explain the
problem:
$ ca
16 matches
Mail list logo