From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23952 invoked by alias); 8 Sep 2013 13:26:15 -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 23917 invoked by uid 48); 8 Sep 2013 13:26:11 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58362] New: Wrong column number for unused parameter Date: Sun, 08 Sep 2013 13:26: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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse 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: 2013-09/txt/msg00492.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58362 Bug ID: 58362 Summary: Wrong column number for unused parameter Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org void f (long s) { } y.cc:1:6: warning: unused parameter 's' [-Wunused-parameter] void f (long s) { } ^ Note the column information, which should point to s instead. I tried the following: --- function.c (revision 202365) +++ function.c (working copy) @@ -4997,21 +4997,22 @@ use_return_register (void) void do_warn_unused_parameter (tree fn) { tree decl; for (decl = DECL_ARGUMENTS (fn); decl; decl = DECL_CHAIN (decl)) if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL && DECL_NAME (decl) && !DECL_ARTIFICIAL (decl) && !TREE_NO_WARNING (decl)) - warning (OPT_Wunused_parameter, "unused parameter %q+D", decl); + warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wunused_parameter, + "unused parameter %q+D", decl); } /* Generate RTL for the end of the current function. */ void expand_function_end (void) { rtx clobber_after; /* If arg_pointer_save_area was referenced only from a nested And I checked in gdb, the first argument of warning_at has the right column information, but it is ignored :-(