From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10057 invoked by alias); 2 Jul 2013 05:15:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9992 invoked by uid 48); 2 Jul 2013 05:15:16 -0000 From: "eggert at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/57773] New: -Wpedantic incorrect warning for enum bit-field Date: Tue, 02 Jul 2013 05:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eggert at gnu dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00053.txt.bz2 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.