public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58362] New: Wrong column number for unused parameter
@ 2013-09-08 13:26 glisse at gcc dot gnu.org
  2013-09-08 14:04 ` [Bug c++/58362] " paolo.carlini at oracle dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-09-08 13:26 UTC (permalink / raw)
  To: gcc-bugs

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 :-(


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-09 13:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-08 13:26 [Bug c++/58362] New: Wrong column number for unused parameter glisse at gcc dot gnu.org
2013-09-08 14:04 ` [Bug c++/58362] " paolo.carlini at oracle dot com
2013-09-08 14:08 ` glisse at gcc dot gnu.org
2013-09-08 14:19 ` paolo.carlini at oracle dot com
2013-09-08 16:26 ` manu at gcc dot gnu.org
2013-09-08 16:41 ` glisse at gcc dot gnu.org
2013-09-08 16:53 ` paolo.carlini at oracle dot com
2013-09-08 16:54 ` paolo.carlini at oracle dot com
2013-09-09 10:47 ` paolo.carlini at oracle dot com
2013-09-09 10:51 ` paolo.carlini at oracle dot com
2013-09-09 11:06 ` paolo.carlini at oracle dot com
2013-09-09 13:40 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).