public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36113]  New: fix C enumerators
@ 2008-05-02 20:14 mrs at apple dot com
  2008-05-02 20:17 ` [Bug c/36113] " mrs at apple dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: mrs at apple dot com @ 2008-05-02 20:14 UTC (permalink / raw)
  To: gcc-bugs

For compatibility with C++ and more reasonable GNU semantics, would we place
make the below program not print 0.  Essentially, the type of all the
enumerators should be the underlying type of the enum, not the type that fits
the init.

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <inttypes.h>

int main(void) {
  enum {
    dummy = (1ULL<<63),
    SomeConstant = 0x1
  } MyEnum;

#define MY_MACRO(value) ((value) << 60)

  printf("MY_MACRO(SomeConstant) == 0x%llx.\n", MY_MACRO(SomeConstant));

  return 0;
}


-- 
           Summary: fix C enumerators
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrs at apple dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-18 14:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36113-4@http.gcc.gnu.org/bugzilla/>
2021-09-17  7:02 ` [Bug c/36113] fix C enumerators pinskia at gcc dot gnu.org
2022-10-18 14:08 ` cvs-commit at gcc dot gnu.org
2022-10-18 14:13 ` jsm28 at gcc dot gnu.org
2008-05-02 20:14 [Bug c/36113] New: " mrs at apple dot com
2008-05-02 20:17 ` [Bug c/36113] " mrs at apple dot com
2008-05-02 20:17 ` mrs at apple dot com
2008-05-05  6:19 ` pinskia at gcc dot gnu dot org
2008-11-15  0:06 ` pinskia at gcc dot gnu dot org
2008-11-15  0:13 ` pinskia at gcc dot gnu dot org
2008-11-18 20:27 ` mrs at apple dot com

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).