This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57170] Diagnostic for a negative case when switching over unsigned comes from -Wsign-conversion instead of -Wpedantic or -Wnarrowing
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 11:43:38 +0000
- Subject: [Bug c++/57170] Diagnostic for a negative case when switching over unsigned comes from -Wsign-conversion instead of -Wpedantic or -Wnarrowing
- Auto-submitted: auto-generated
- References: <bug-57170-4@http.gcc.gnu.org/bugzilla/>
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.