This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/17211] [sparc/i386]: Bitfields should be *unsigned* by default.


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]