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
* [Bug c/57773] -Wpedantic incorrect warning for enum bit-field
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 ` mpolacek at gcc dot gnu.org
2014-01-03 14:11 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-07-05 16:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57773
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-07-05
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yeah, I think you're right. Confirmed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/57773] -Wpedantic incorrect warning for enum bit-field
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
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-03 14:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57773
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
After all, I think it'd be wise to keep the warning for ISO C, but turn if off
for C99/C11. I have a patch for that.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/57773] -Wpedantic incorrect warning for enum bit-field
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
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-06 18:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57773
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Mon Jan 6 18:53:01 2014
New Revision: 206373
URL: http://gcc.gnu.org/viewcvs?rev=206373&root=gcc&view=rev
Log:
PR c/57773
* doc/implement-c.texi: Mention that other integer types are
permitted as bit-field types in strictly conforming mode.
c/
* c-decl.c (check_bitfield_type_and_width): Warn for implementation
defined bit-field types only in ISO C.
testsuite/
* gcc.dg/pr57773.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr57773.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-decl.c
trunk/gcc/doc/implement-c.texi
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/57773] -Wpedantic incorrect warning for enum bit-field
2013-07-02 5:15 [Bug c/57773] New: -Wpedantic incorrect warning for enum bit-field eggert at gnu dot org
` (2 preceding siblings ...)
2014-01-06 18:53 ` mpolacek at gcc dot gnu.org
@ 2014-01-06 18:53 ` mpolacek at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-06 18:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57773
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.
^ 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).