From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C976F3858C27; Mon, 18 Oct 2021 20:09:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C976F3858C27 From: "pavel.morozkin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/102821] New: Tentative definition of variable with internal linkage has incomplete non-array type: missing diagnostics Date: Mon, 18 Oct 2021 20:09:36 +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: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pavel.morozkin at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2021 20:09:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102821 Bug ID: 102821 Summary: Tentative definition of variable with internal linkage has incomplete non-array type: missing diagnostics Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: pavel.morozkin at gmail dot com Target Milestone: --- Sample code (t940.c): static struct s foo; static struct s {int a;} foo; Invocation: $ gcc t940.c -c -std=3Dc11 -pedantic -Wall -Wextra -Wno-unused-variable Expected diagnostics: t940.c:1:17: warning: tentative definition of variable with internal linkage has incomplete non-array type 'struct s' [-Wtentative-definition-incomplete-type] Actual diagnostics: Notes: 1. C11, 6.9.2 External object definitions, 3: > If the declaration of an identifier for an object is a tentative definiti= on and has internal linkage, the declared type shall not be an incomplete t= ype. 2. C11, 4. Conformance, 1: > In this International Standard, =E2=80=98=E2=80=98shall=E2=80=99=E2=80=99= is to be interpreted as a requirement on an implementation or on a program= ; conversely, =E2=80=98=E2=80=98shall not=E2=80=99=E2=80=99 is to be interp= reted as a prohibition.=