From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2146 invoked by alias); 21 Apr 2015 11:03:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2087 invoked by uid 48); 21 Apr 2015 11:03:09 -0000 From: "trippels at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65801] [5/6 Regression] Allow -Wno-narrowing to silence stricter C++11 narrowing rules Date: Tue, 21 Apr 2015 11:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: trippels at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01716.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65801 --- Comment #17 from Markus Trippelsdorf --- (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #16) > What is printed with -Wno-error=3Dnarrowing ? Try it yourself? Just a warning. >>From gcc-bugs-return-484165-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 21 11:09:29 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 21638 invoked by alias); 21 Apr 2015 11:09:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 21598 invoked by uid 48); 21 Apr 2015 11:09:26 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65801] [5/6 Regression] Allow -Wno-narrowing to silence stricter C++11 narrowing rules Date: Tue, 21 Apr 2015 11:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01717.txt.bz2 Content-length: 1416 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65801 --- Comment #18 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #16) > What is printed with -Wno-error=3Dnarrowing ? I'm also a bit afraid of how setting pedantic-errors in this way interacts = with the #pragma GCC diagnostics. Wouldn't it be better to reclassify -Wnarrowin= g as an error (see diagnostic_classify_diagnostic) then simulate a #pragma GCC diagnostics pop to restore the previous state? The problem is the order in which the re-classification happens, which should appear as if it happened = in the command-line and not at the point of warning, but diagnostic_classify_diagnostic assumes #pragmas are handled in the order gi= ven in the source code. Another alternative, perhaps simpler, would be to have a different option -Wnarrowing-strict, which by default is -Werror=3Dnarrowing-strict (see Werror-implicit-function-declaration) and it is enabled by -Wnarrowing. This way, everything should work as expected (unless latent bugs in the options handling machinery for not passing the error/warning state correctly when enabling dependant options). An even simpler options is to put this under -fpermissive so people realize that what they are doing is very wrong according to the standard (if it is = not very wrong, then why error and not just pedwarn?). >>From gcc-bugs-return-484166-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 21 11:10:48 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 23620 invoked by alias); 21 Apr 2015 11:10:44 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 23571 invoked by uid 48); 21 Apr 2015 11:10:38 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65801] [5/6 Regression] Allow -Wno-narrowing to silence stricter C++11 narrowing rules Date: Tue, 21 Apr 2015 11:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01718.txt.bz2 Content-length: 484 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D65801 --- Comment #19 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Markus Trippelsdorf from comment #17) > (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #16) > > What is printed with -Wno-error=3Dnarrowing ? >=20 > Try it yourself? > Just a warning. Thanks, well at least that works. I guess if someone notices a problem with= the #pragmas, a better solution can be found later. >>From gcc-bugs-return-484167-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 21 11:17:55 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 97677 invoked by alias); 21 Apr 2015 11:17:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 97646 invoked by uid 48); 21 Apr 2015 11:17:52 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65801] [5/6 Regression] Allow -Wno-narrowing to silence stricter C++11 narrowing rules Date: Tue, 21 Apr 2015 11:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01719.txt.bz2 Content-length: 300 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65801 --- Comment #20 from Jonathan Wakely --- The problem with -fpermissive is that it doesn't just allow things like narrowing that are valid in C++03 but also allows all kind of ancient constructs that no sane person wants.