From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A4910385742B; Wed, 5 Oct 2022 22:05:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4910385742B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665007523; bh=6zGrwiqWNqUcv/hpwkzu0MWYsAonfk+okvHN71srx6c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b6Xxhz+hsinrACK4zrH6tM6XeKaIPI807eRx2tHyPCUi9r4Fw0mhDZ+PwjLubjmQN KanhtVcPLFkuaUhr9miNehSbG1At2C9+pNPNAhRlAA9y/M2MPA+pOHr3aU6itfNF6J qIYNmuveSe/+6WePhO64QmLFhU3+uVhogph7ZvPo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107164] No pedantic warning for declaration just referring to a previously-declared enum type Date: Wed, 05 Oct 2022 22:05:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107164 --- Comment #1 from Andrew Pinski --- clang says it is a GCC extension: :2:6: warning: redeclaration of already-defined enum 'E' is a GNU extension [-Wgnu-redeclared-enum] enum E; ^ :1:6: note: previous definition is here enum E {a,b,c}; ^ GCC does have a forward declaration extension for enum types so it makes se= nse to allow this as an extension too. That is: ``` enum E; enum E {a,b,c}; ``` (which GCC does have a pedantic diagnostic about).=