public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105131] New: Warning for mismatched declaration/definition with enum
@ 2022-04-01 19:56 rth at gcc dot gnu.org
  2022-04-01 20:17 ` [Bug c/105131] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rth at gcc dot gnu.org @ 2022-04-01 19:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105131

            Bug ID: 105131
           Summary: Warning for mismatched declaration/definition with
                    enum
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rth at gcc dot gnu.org
  Target Milestone: ---

For a testcase such as

enum E { l = -1, z = 0, g = 1 };
int foo(void);
enum E foo(void) { return z; }

If the implementation type of 'enum E' is not 'int',
we will correctly emit an error (e.g. -fshort-enums).

It would be desirable to emit a warning in this case,
because it is probably a mistake and definitely a
portability error.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-18 23:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 19:56 [Bug c/105131] New: Warning for mismatched declaration/definition with enum rth at gcc dot gnu.org
2022-04-01 20:17 ` [Bug c/105131] " mpolacek at gcc dot gnu.org
2022-04-01 20:59 ` mpolacek at gcc dot gnu.org
2022-05-17 20:34 ` mpolacek at gcc dot gnu.org
2022-05-18 23:13 ` cvs-commit at gcc dot gnu.org
2022-05-18 23:14 ` mpolacek at gcc dot gnu.org

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).