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.