[Bug c/71803] Wpedantic: enumerator value is not an integer constant expression

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 7 21:55:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71803

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
1 << 31

is not a constant integral expression in C99/C90/C11 since you are overflowing
the 1 to the sign bit.  If you want 1 << 31, then you can use "(int)(1u << 31)"
or if you want unsigned then you can just do 1u << 31.


More information about the Gcc-bugs mailing list