From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C0BC3858C27; Tue, 22 Nov 2022 09:19:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C0BC3858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669108772; bh=aJSYkmfouCw6wsZEOja43Xa/OIAWzy933CgYK/hA/bU=; h=From:To:Subject:Date:From; b=vwLpolCkmA1exlebAASYkRsnwqF0yl9rPFYsP/aDRuuvNg+tjtSCp82tivE12rMa9 p2NKTjDCFyLlsdpW60u6pEobK2l4oddbCRghMThs5GsBgfBXQ59hrppk3nrjAAzZg5 J5MW+ricrQJo8Vrvk9uDiv9f7+VQVb+rcpMEO6ik= From: "fw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107805] New: Spurious warning after redefinition of type Date: Tue, 22 Nov 2022 09:19:31 +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: 12.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: fw 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: bug_id short_desc product version bug_status keywords 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107805 Bug ID: 107805 Summary: Spurious warning after redefinition of type Product: gcc Version: 12.2.1 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: fw at gcc dot gnu.org Target Milestone: --- With gcc-11.3.1-3.fc35.x86_64, this program typedef int t; typedef struct { double a; int b; } t; t x; produces: t.c:2:37: error: conflicting types for =E2=80=98t=E2=80=99; have =E2=80=98s= truct =E2=80=99 2 | typedef struct { double a; int b; } t; | ^ t.c:1:13: note: previous declaration of =E2=80=98t=E2=80=99 with type =E2= =80=98t=E2=80=99 {aka =E2=80=98int=E2=80=99} 1 | typedef int t; | ^ which is expected. But with gcc-12.2.1-3.fc38.x86_64, I get this instead: t.c:2:37: error: conflicting types for =E2=80=98t=E2=80=99; have =E2=80=98s= truct =E2=80=99 2 | typedef struct { double a; int b; } t; | ^ t.c:1:13: note: previous declaration of =E2=80=98t=E2=80=99 with type =E2= =80=98t=E2=80=99 {aka =E2=80=98int=E2=80=99} 1 | typedef int t; | ^ t.c:3:3: warning: type defaults to =E2=80=98int=E2=80=99 in declaration of = =E2=80=98x=E2=80=99 [-Wimplicit-int] 3 | t x; | ^ Note the spurious warning. This causes problems with attempts to eliminate implicit int, so it would be nice to fix this.=