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 fails.
... 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 program.
... 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. Thanks, --- grischka _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel