From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28580 invoked by alias); 16 Jan 2014 18:13:01 -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 28156 invoked by uid 48); 16 Jan 2014 18:12:55 -0000 From: "chengniansun at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/59846] New: Imprecise column number for -Wtype-limits Date: Thu, 16 Jan 2014 18:13: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: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chengniansun at gmail dot com 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 bug_severity priority component assigned_to reporter Message-ID: 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: 2014-01/txt/msg01737.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59846 Bug ID: 59846 Summary: Imprecise column number for -Wtype-limits Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com GCC outputs a wrong column number of a type-limit (comparison between 0 and unsigned) warning.=20 $ gcc-trunk -Wall -Wextra -c -std=3Dc11 -pedantic s.c s.c: In function =E2=80=98fn1=E2=80=99: s.c:33:3: warning: comparison is always false due to limited range of data = type [-Wtype-limits] return b ^=3D ( b < (0UL > p)); ^ $ clang-trunk -Wall -Wextra -c -std=3Dc11 -pedantic s.c s.c:33:38: warning: comparison of 0 > unsigned expression is always false [-Wtautological-compare] return b ^=3D ( b < (0UL > p)); ~~~ ^ ~ 1 warning generated. $ cat s.c int fn1(unsigned p) { int b =3D 99; return b ^=3D ( b < (0UL > p)); } >>From gcc-bugs-return-440596-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 16 18:18:18 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 8363 invoked by alias); 16 Jan 2014 18:18:18 -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 7973 invoked by uid 48); 16 Jan 2014 18:18:13 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59821] __builtin_LINE and __builtin_FILE for new'd objects is wrong Date: Thu, 16 Jan 2014 18:18: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.8.2 X-Bugzilla-Keywords: wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: jason 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: 2014-01/txt/msg01738.txt.bz2 Content-length: 626 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59821 --- Comment #6 from Jason Merrill --- (In reply to Jakub Jelinek from comment #4) > While I agree with that, for _builtin_{LINE,FILE,FUNCTION} (), those were > added specifically for the use in default arguments and were I think from > the start meant to give you the location of the call, not of the token where > it appears, otherwise those builtins don't make much sense (you could use > __LINE__, __FILE__ or __FUNCTION__ instead). Ah, I see. In that case, I agree that adjusting their locations in break_out_target_exprs is the way to go.