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 c++/57170] Diagnostic for a negative case when switching over unsigned comes from -Wsign-conversion instead of -Wpedantic or -Wnarrowing


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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Diagnostics for narrowing conversions involving non-constants are controlled by
-Wnarrowing (allowing them to be either warnings or errors). But narrowing
conversions involving constants are always errors. Case labels must be
constants, so making this depend on -Wnarrowing wouldn't seem appropriate to
me.

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