This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: 64-bit enums and left shift operator - invalid code or GCC bug?
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: <jens dot kilian at verigy dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 27 Jun 2008 07:04:43 -0500
- Subject: Re: 64-bit enums and left shift operator - invalid code or GCC bug?
Hi Jens,
> Is this a GCC bug, or does the standard really require this conversion?
I'm not sure.
Does C99 now allow enum to be something other than (signed, unsigned) int?
(That'd make C99 more like C++ regarding enum sizes.)
Or does GCC have an extension which allows enum to be something other than
int-sized for C?
Do you need to specify -std=iso9899:1999 to get C99-isms? Or is that the C
default on your GCC?
Shouldn't you be using <inttypes.h> and have your printf be:
printf("%" PRIx64 " %" PRIx64 "\n", zip, qux);
(Not that I'm C99 savvy in the least, since I haven't really used C since
1990.)
Sincerely,
--Eljay