public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/4077: -fshort-enums makes enumerations behave like unsigned int not int
@ 2002-04-02 20:05 rth
0 siblings, 0 replies; only message in thread
From: rth @ 2002-04-02 20:05 UTC (permalink / raw)
To: cristan, gcc-bugs, gcc-prs, nobody
Synopsis: -fshort-enums makes enumerations behave like unsigned int not int
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Apr 2 20:05:20 2002
State-Changed-Why:
Not a bug. With -fshort-enums, enumerations with no negative
values are represented with a type compatible with unsigned short.
The semantics of ((unsigned short)-1) == -1, is that the
arithmetic conversions are applied. For targets in which
sizeof(short) < sizeof(int) holds true, the promoted type
is int, and we compare a zero-extended version of the short
(i.e. 0xffff == -1 for most targets).
Which is of course going to be false.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4077
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-03 4:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-02 20:05 optimization/4077: -fshort-enums makes enumerations behave like unsigned int not int rth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).