This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50810] c++0x-compat does not warn about narrowing conversions
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Oct 2011 12:35:49 +0000
- Subject: [Bug c++/50810] c++0x-compat does not warn about narrowing conversions
- Auto-submitted: auto-generated
- References: <bug-50810-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50810
--- Comment #18 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-10-24 12:35:49 UTC ---
Paolo, I am sorry to say it so bluntly but this solution is nonsense:
http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02160.html
I know it is what Gabriel requested, but it doesn't make sense.
* It doesn't make sense to have a warning conditional of an option when the
negated option cannot disable it. Just don't give it any option then.
* It doesn't make sense that the warning is emitted with option Wnarrowing but
it is disabled by option -Wno-c++0x-compat. This also breaks consistency with
the pragmas and with -Werror=c++0x-compat versus -Werror=narrowing.
* It doesn't make sense to force users to see a warning when they have
requested to not see it using -Wno-narrowing!
Honestly, listen to Jason's stated opinion here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49793#c2
This PR is only about adding -Wnarrowing to -Wc++0x-compat to get a warning
when not using -std=c++0x. Nothing else. It was fixed by your first patch (plus
not enabling -Wc++0x-compat with -Wall). If you have asked Jason, that patch
would have been pre-approved and committed long ago!