public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "fw at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-107805-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107805 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 ‘t’; have ‘struct <anonymous>’ 2 | typedef struct { double a; int b; } t; | ^ t.c:1:13: note: previous declaration of ‘t’ with type ‘t’ {aka ‘int’} 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 ‘t’; have ‘struct <anonymous>’ 2 | typedef struct { double a; int b; } t; | ^ t.c:1:13: note: previous declaration of ‘t’ with type ‘t’ {aka ‘int’} 1 | typedef int t; | ^ t.c:3:3: warning: type defaults to ‘int’ in declaration of ‘x’ [-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.
next reply other threads:[~2022-11-22 9:19 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-22 9:19 fw at gcc dot gnu.org [this message] 2022-11-22 9:27 ` [Bug c/107805] [12/13 Regression] Spurious “type defaults to ‘int’” " rguenth at gcc dot gnu.org 2022-11-22 9:40 ` fw at gcc dot gnu.org 2022-11-22 9:43 ` redi at gcc dot gnu.org 2022-11-22 9:51 ` jakub at gcc dot gnu.org 2022-11-22 9:57 ` jakub at gcc dot gnu.org 2022-11-22 12:21 ` fw at gcc dot gnu.org 2022-11-24 10:02 ` cvs-commit at gcc dot gnu.org 2022-11-24 10:02 ` fw at gcc dot gnu.org 2023-05-08 12:26 ` [Bug c/107805] [12 " rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107805-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).