Possible C++ bug: Are C enum tags unsigned?

Chip Salzenberg chip@valinux.com
Fri Jun 9 13:52:00 GMT 2000


I ask because gcc is reporting a signed/unsigned comparison on line
449 of gcc/cp/cfns.h:

449:    else if (index < -TOTAL_KEYWORDS)

Now, 'index' is of type 'int', and thus signed.  So, by a process of
elimination, I deduce that TOTAL_KEYWORDS is unsigned.  (And, of
course, arithmetic negation of an unsigned value is also unsigned.)

Two questions:  (1) Are enum tags _supposed_ to be unsigned?
                (2) If so, is this line buggy, or not?

adTHANKSvance
-- 
Chip Salzenberg              - a.k.a. -              <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K


More information about the Gcc-bugs mailing list