[Bug c/57773] New: -Wpedantic incorrect warning for enum bit-field
eggert at gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jul 2 05:15:00 GMT 2013
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.
More information about the Gcc-bugs
mailing list