From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28800 invoked by alias); 6 Jul 2015 08:59:23 -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 28771 invoked by uid 48); 6 Jul 2015 08:59:20 -0000 From: "daniel.marjamaki at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/37591] suppress "signed and unsigned" warnings when signed value known to be positive Date: Mon, 06 Jul 2015 08:59: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: 4.3.2 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: daniel.marjamaki at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: cc 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-07/txt/msg00428.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D37591 Daniel Marjam=C3=A4ki changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.marjamaki at gmail = dot com --- Comment #7 from Daniel Marjam=C3=A4ki --- +1 This is very annoying. My code is: unsigned int dostuff(); void f(int x) { if (x >=3D 0 && x < dostuff()) {} } This kind of false positive is indirectly a security problem. People routin= ely hide these false positives using casts or changed variable types etc. and t= hat cause bugs and hides other real warnings. I'd vote for either removing this warning or fixing it. >>From gcc-bugs-return-491539-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jul 06 09:03:48 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 58031 invoked by alias); 6 Jul 2015 09:03:48 -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 57986 invoked by uid 48); 6 Jul 2015 09:03:43 -0000 From: "trippels at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66774] Any optimization causes segfault on binary Date: Mon, 06 Jul 2015 09: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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: trippels at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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_status cc resolution 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-07/txt/msg00429.txt.bz2 Content-length: 1275 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66774 Markus Trippelsdorf changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |trippels at gcc dot gnu.org Resolution|--- |INVALID --- Comment #1 from Markus Trippelsdorf --- In cases like this please build your code with -fsanitize=undefined. code.cpp:58:39: runtime error: index 4 out of bounds for type 'int [4][2]' code.cpp:58:42: runtime error: load of address 0x000000410b00 with insufficient space for an object of type 'const int' 0x000000410b00: note: pointer points here 01 00 00 00 ff ff 01 10 5f 05 a8 05 00 ab 05 05 00 00 b0 05 05 a8 05 00 ff ff 01 11 b1 01 05 00 ^ code.cpp:59:39: runtime error: index 4 out of bounds for type 'int [4][2]' code.cpp:59:42: runtime error: load of address 0x000000410b04 with insufficient space for an object of type 'const int' 0x000000410b04: note: pointer points here ff ff 01 10 5f 05 a8 05 00 ab 05 05 00 00 b0 05 05 a8 05 00 ff ff 01 11 b1 01 05 00 00 f8 07 cc