From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73252 invoked by alias); 17 Mar 2015 08:45:20 -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 73183 invoked by uid 48); 17 Mar 2015 08:45:14 -0000 From: "joerg.richter@pdv-fs.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/64634] [4.8/4.9 Regression] gcov reports catch(...) as not executed Date: Tue, 17 Mar 2015 08:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 4.8.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joerg.richter@pdv-fs.de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.5 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-03/txt/msg01659.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64634 --- Comment #6 from J=C3=B6rg Richter --- Is this stable enough to be considered for 4.9.3? >>From gcc-bugs-return-480516-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 17 08:51:25 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 98599 invoked by alias); 17 Mar 2015 08:51:25 -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 98540 invoked by uid 48); 17 Mar 2015 08:51:21 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/65446] New: Improve -Wformat-signedness Date: Tue, 17 Mar 2015 08:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter Message-ID: 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-03/txt/msg01660.txt.bz2 Content-length: 1507 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65446 Bug ID: 65446 Summary: Improve -Wformat-signedness Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org As PR 65040 shows, the current implementation of -Wformat-signedness is not optimal. (When it is more robust, one could consider to re-enable it with -Wformat=2.) The idea of the warning is to warn for "%ld", size_t_variable as one has to use "%lu" to print the negative values. Or reversely using %u for a signed value, where it is even more likely that the issue occurs. See also "cppcheck --enable=warning" which supports this warning. (But its warning pattern makes more sense than GCC's.) GCC's current implementation warns too often - and misses some cases. The main bug is that it doesn't take type promotion into account. In particular: It warns for: printf ("%u\n", unsigned_short); but shouldn't: First, %u and unsigned_short are both unsigned. (It also shouldn't and doesn't warn for %d with unsigned short as all values are representible by %d. It doesn't warn but should warn for printf("%u\n", _short); As passing, e.g., (short)-1 to %u will print the wrong value (UINT_MAX instead of -1). GCC currently also warns for printf("%x\n", 1), which is very questionable.