public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57773] New: -Wpedantic incorrect warning for enum bit-field
@ 2013-07-02  5:15 eggert at gnu dot org
  2013-07-05 16:43 ` [Bug c/57773] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: eggert at gnu dot org @ 2013-07-02  5:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57773
           Summary: -Wpedantic incorrect warning for enum bit-field
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at gnu dot org

Given this program in the file t.c:

  enum e { zero };
  struct { enum e field: 2; } s;

The command "gcc -Wpedantic -S t.c" outputs:

  t.c:2:15: warning: type of bit-field 'field' is a GCC extension [-Wpedantic]
  struct { enum e field: 2; } s;

This diagnostic should not be output.  -Wpedantic is supposed to
generate only diagnostics required by the standard.  But this
diagnostic is not required by C99 or by C11, since these standards
allow this GCC extension and do not require a diagnostic if the
extension is used.  And the diagnostic is not required by C89 since no
constraint is violated.


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

end of thread, other threads:[~2014-01-06 18:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02  5:15 [Bug c/57773] New: -Wpedantic incorrect warning for enum bit-field eggert at gnu dot org
2013-07-05 16:43 ` [Bug c/57773] " mpolacek at gcc dot gnu.org
2014-01-03 14:11 ` mpolacek at gcc dot gnu.org
2014-01-06 18:53 ` mpolacek at gcc dot gnu.org
2014-01-06 18:53 ` mpolacek at gcc dot gnu.org

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