How to warn when assigning or performing arithmetic with different enum types in GCC? How to warn when assigning or performing arithmetic with different enum types in GCC? c c

How to warn when assigning or performing arithmetic with different enum types in GCC?


According to this answer, only clang supports the desired behavior.

There are some approaches to emulate strongly typed enums in C, but they seem to have various limitations.