MS-style bit-field placement

Alexandre Oliva
Sun Apr 15 09:59:00 GMT 2001

On Apr 14, 2001, Mumit Khan <khan@NanoTech.Wisc.EDU> wrote:

>> On Apr 14, 2001, Alexandre Oliva <> wrote:

>> > Here's a patch that makes GCC capable of placing bit-fields exactly
>> > like Microsoft compilers do.  Or so it seems to me.

> Have you taken a look at Donn Terry's old patch (Cygwin and Mingw have
> been using this for a long time now)?

Ha!  So *that's* why I had the impression GCC was already capable of
producing MSVC-style bit fields, and was surprised to find out it
didn't, and ended up implementing it.

>    URL:

> You may want to take a look at the testcase that Donn provides.

Thanks.  His patch is probably something that should eventually be
integrated in GCC.  At least the ability to change bit-field placement
modes with attributes looks like a good idea to me.  The only thing I
dislike in that patch is calling the MSVC style ``native''.  I
understand it's the native format for MS OSs, but that's it.  What if
we called the PCC bit-field placement ``native'', just because it
happens to be the native format of OSs that used PCC as the default
compiler? :-)

Thanks for the pointer to the testcases!  They look familiar to me,
but testing this stuff is never too much :-)

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

More information about the Gcc-patches mailing list