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 memory. You could alter that code to always use the smallest storage-size, and automatically upsize to the larger form, such as something stored as 1..7 bits always being stored as a single byte, even if it's scoped as an int.
Such a patch would be desirable, and could work with a command-line switch (something like --pack-bit-fields). Best regards, Rick C. Hodgin --- On Sun, 5/27/12, Didier Barvaux <did...@barvaux.org> wrote: > From: Didier Barvaux <did...@barvaux.org> > 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 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 check > for this > compiler's behaviour in my configure script. > > The code of my example is a reduced version of struct iphdr > defined > by GNU libc's netinet/ip.h. It means that every programs > using the > GNU libc's IPv4 header (or its BSD variant) cannot work fine > if built > with tinycc. > > Regards, > Didier > > -----Inline Attachment Follows----- > > _______________________________________________ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel