This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/81598] -fsanitize=enum does not detect range violation


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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As for the switch, I think there shouldn't be any runtime error, there is no
UB.
You can have default: label even if you list all the possible in-range cases,
you can have enum values in between min/max that aren't in the enumeration, and
you can have case labels outside of the enum range too, that is something for a
warning, but not a runtime error.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]