Using __extension__ in a struct with a GTY(()) mark
Jason Merrill
jason@redhat.com
Thu Apr 3 03:17:00 GMT 2003
On Wed, 2 Apr 2003 18:00:52 -0500 (EST), "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote:
> I'm trying to enable compiling the G++ frontend using any ISOC
> compiler. In effect, this means getting it to compile with gcc
> -pedantic. I've zapped all problems except one in which I'm running
> into a problem with gengtype and a structure using GTY(()) when I try
> to use the __extension__ keyword.
If you need to use __extension__, it won't work on other ISO C compilers.
If you really want to compile g++ with other C compilers, you need to avoid
using char bitfields.
> I added code in system.h to appropriately use int or char depending on
> whether we're using GCC via a macro CHAR_BITFIELD.
Why? If they're interchangeable, why not always use int? The problem is
that they aren't interchangeable on PCC_BITFIELD_TYPE_MATTERS targets;
using int will impose int alignment on the struct, which breaks its
intended use (if I understand it properly).
> Please help?
I'd be inclined to give up. What's wrong with requiring gcc for building
the other frontends?
Jason
More information about the Gcc
mailing list