This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/17211] [sparc/i386]: Bitfields should be *unsigned* by default.
- From: "terra at gnome dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2004 15:14:57 -0000
- Subject: [Bug target/17211] [sparc/i386]: Bitfields should be *unsigned* by default.
- References: <20040827145141.17211.terra@gnome.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From terra at gnome dot org 2004-08-30 15:14 -------
You're reading things into the standard that aren't there. Here's what it says
on the topic:
[#5] Each of the comma-separated sets designates the same
type, except that for bit-fields, it is implementation-
defined whether the specifier int designates the same type
as signed int or the same type as unsigned int.
Note, that the expection is for the *specifier* int, not the C-type int.
Therefore "short int" etc. are perfectly covered by the very same clause.
(I guess that leaves "char" if you really wanted to nit-pick about it.)
Note, that the language laywers at Sun seem to have decided that the smaller
types should be unsigned by default too.
The rant in trouble.texi is misguided. The ABIs make lots of random choices
for which one could write an almost identical rant. (Bit-field packing;
int alignment.)
I translate trouble.texi into "I don't like what the ABI says". That is
rather inappropriate because after all the purpose of following an ABI is
to facilitate inter-operability.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17211