https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107377
Bug ID: 107377 Summary: Warn about duplicate enum values? Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: mpolacek at gcc dot gnu.org Target Milestone: --- Noticed that while investigating PR107364: enum processor_vendor { VENDOR_INTEL = 1, VENDOR_AMD, VENDOR_ZHAOXIN, VENDOR_OTHER, VENDOR_CENTAUR, VENDOR_CYRIX, VENDOR_NSC, BUILTIN_VENDOR_MAX = VENDOR_OTHER, VENDOR_MAX }; As one can see VENDOR_CENTAUR == 5, but VENDOR_MAX is also == 5 as BUILTIN_VENDOR_MAX points to 4 and thus VENDOR_MAX == 5. Maybe we can warn about 2 enum values that have the same value and none of them is defined with '= some_value'. What do you think?