These warnings have driven me insane for years: blah.cc:1: error: too many arguments to function ‘void a(int)’ blah.cc:7: error: at this point in file I always end up jumping to line 1 in the file. I glance at the message and line number in the first line, and I'm jumping to that line number before my brain has really processed which error message it is. This is inherently something I can't learn to work around without deliberately slowing down my workflow (a mental pipeline stall?). The line number next to the error should be the one causing the error; any additional, related lines should come *after*. This is much better: blah.cc:7: error: too many arguments to function ‘void a(int)’ blah.cc:1: error: declared here This also makes it consistent with the C version of this error.
Confirmed. The C front-end just emits: t.c: In function ‘g’: t.c:4:3: error: too many arguments to function ‘f’ While the C++ front-end emits: t.c:1:5: error: too many arguments to function ‘int f(int)’ t.c:4:16: error: at this point in file
I should say the simple example was: int f(int); int g(int a, int b) { return f(a, b); }
("4:16"? I havn't seen that before. I hope gcc isn't going to start outputting character offsets by default; that's a lot of noise.)
Subject: Re: "at this point in file" warnings are upside down Sent from my iPhone On Feb 19, 2010, at 10:51 PM, "glenn at zewt dot org" <gcc-bugzilla@gcc.gnu.org > wrote: > > > ------- Comment #3 from glenn at zewt dot org 2010-02-20 06:51 > ------- > ("4:16"? I havn't seen that before. I hope gcc isn't going to start > outputting character offsets by default; that's a lot of noise.) Yes gcc is now printing out column information. And no it is not a lot of noise. > > > -- > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126 >
(In reply to comment #3) > ("4:16"? I havn't seen that before. I hope gcc isn't going to start > outputting character offsets by default; that's a lot of noise.) > From GCC 4.5, you can disable it with -fno-show-column.
I have a patch.
Subject: Bug 43126 Author: manu Date: Mon Feb 22 22:30:45 2010 New Revision: 156979 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156979 Log: 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c++/43126 * c-typeck.c (convert_arguments): Print declaration location. * c-common.c (validate_nargs): Rename as builtin_function_validate_nargs. (check_builtin_function_arguments): Update. cp/ * typeck.c (convert_arguments): Update error message. testsuite/ * gcc.dg/cleanup-1.c: Update. * gcc.dg/func-args-1.c: Update. * gcc.dg/format/sentinel-1.c: Update. * g++.old-deja/g++.jason/scoping10.C: Update. * g++.old-deja/g++.ns/lookup5.C: Update. * g++.dg/ext/cleanup-1.C: Update. * g++.dg/parse/varmod1.C: Update. * g++.dg/parse/error33.C: Update. * g++.dg/expr/call3.C: Update. * g++.dg/func-args-1.C: New. Added: trunk/gcc/testsuite/g++.dg/func-args-1.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/c-typeck.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/expr/call3.C trunk/gcc/testsuite/g++.dg/ext/cleanup-1.C trunk/gcc/testsuite/g++.dg/parse/error33.C trunk/gcc/testsuite/g++.dg/parse/varmod1.C trunk/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C trunk/gcc/testsuite/g++.old-deja/g++.ns/lookup5.C trunk/gcc/testsuite/gcc.dg/cleanup-1.c trunk/gcc/testsuite/gcc.dg/format/sentinel-1.c trunk/gcc/testsuite/gcc.dg/func-args-1.c
FIXED in GCC 4.5
*** Bug 38468 has been marked as a duplicate of this bug. ***