[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] question about bit-fields

From: grischka
Subject: Re: [Tinycc-devel] question about bit-fields
Date: Sat, 20 Oct 2012 21:59:29 +0200
User-agent: Thunderbird (Windows/20100228)

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 some code
that manages IPv4 headers [1]. The code uses the 'struct iphdr' of the
GNU libc, and relies on its size doing exactly 20 bytes. TCC does not
compute the structure length the same way GCC does, and the program

... the same way GCC does?

Someone told me that I can add code to mimic the behaviour of GCC. The
attached patch is an attempt to do so. It is probably not very good as
I didn't known TCC's codebase before, but it seems to work. I'm open
for comments on it. I tested my modifications with the attached test

... to mimic the behavior of GCC?

Just curious:  What now is this way/behavior of GCC, actually?

Because as you say, maybe the patch is not very good (e.g. suspicious
"copy & paste" portion) but you didn't know TCC before.

Then again maybe some people here know TCC but still can't really
comment your patch or suggest improvements because they don't know
the details about GCC's bit packing right now.


--- grischka

reply via email to

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