This is the mail archive of the gcc-help@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]

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


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