[PATCH] DEFAULT_SIGNED_BITFIELDS Macro
Thu Jun 3 08:26:00 GMT 1999
In a submitted patch, I have a fix for a vaguely similar problem
(the way bitfields are packed in native vs. "gcc" mode.)
That same patch includes the mechanism for a flag (that could
well set a number of finer-grained options) called "native-struct",
which means "generate structures for the native compiler" (no,
I didn't address the issue of 2 incompatible native compilers ;-) ).
(There's also a corresponding __attribute__ to allow mixing the
I'd suggest that rather than trying to address this issue one
piece at a time (from a user point of view) that a single flag
that is either "native" or "gcc" be provided. (Under the covers,
this probably sets a bunch of different flags on different
architectures, but 99% of users don't care HOW a structure is
layed out, just that it's compatible with existing code or the
ABI, or with file images.)
No comment on what the default should be.
Jeffrey A Law wrote:
> In message < 19990602083208U.email@example.com >you write:
> > I don't think that this patch is in the spirit of GNU CC, as recorded
> > in the current manual. We could decide to change the manual, but I
> > think it would be a not-insignificant change. Before doing so, I
> > suggest that the steering committee think carefully about the
> > rationale for doing so, and debate the manual section quoted below.
> This may not be in the spirit of GCC, but if we fail to keep the signedness
> of bitfields the same as it has already been on that platform for years we
> introduce a stupid and totally avoidable change in the ABI.
> ie, that port has had signed bitfields for years. Changing it now is, IMHO
> too late, this needed to have been caught and fixed a long time ago.
> Note that it is still possible to explicitly ask for signed or unsigned
> And the signedness of bitfields does matter from an ABI standpoint, contrary
> to what the manual states. I've been nailed badly by it in the past.
Donn Terry mailto:firstname.lastname@example.org
Softway Systems, Inc. http://www.interix.com
2850 McClelland Dr, Ste. 1800 Ft.Collins CO 80525
Tel: +1-970-204-9900 Fax: +1-970-204-9951
More information about the Gcc-patches