public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43126]  New: "at this point in file" warnings are upside down
@ 2010-02-20  5:22 glenn at zewt dot org
  2010-02-20  6:25 ` [Bug c++/43126] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: glenn at zewt dot org @ 2010-02-20  5:22 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

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.


-- 
           Summary: "at this point in file" warnings are upside down
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: glenn at zewt dot org
  GCC host triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
@ 2010-02-20  6:25 ` pinskia at gcc dot gnu dot org
  2010-02-20  6:27 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-20  6:25 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 898 bytes --]



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-02-20 06:25 -------
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


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   GCC host triplet|i486-linux-gnu              |
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2010-02-20 06:25:29
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
  2010-02-20  6:25 ` [Bug c++/43126] " pinskia at gcc dot gnu dot org
@ 2010-02-20  6:27 ` pinskia at gcc dot gnu dot org
  2010-02-20  6:51 ` glenn at zewt dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-20  6:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2010-02-20 06:27 -------
I should say the simple example was:
int f(int);
int g(int a, int b)
{
  return f(a, b);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
  2010-02-20  6:25 ` [Bug c++/43126] " pinskia at gcc dot gnu dot org
  2010-02-20  6:27 ` pinskia at gcc dot gnu dot org
@ 2010-02-20  6:51 ` glenn at zewt dot org
  2010-02-20  9:00   ` Andrew Pinski
  2010-02-20  9:01 ` pinskia at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: glenn at zewt dot org @ 2010-02-20  6:51 UTC (permalink / raw)
  To: gcc-bugs



------- 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.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* Re: [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  6:51 ` glenn at zewt dot org
@ 2010-02-20  9:00   ` Andrew Pinski
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Pinski @ 2010-02-20  9:00 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs



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
>


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
                   ` (2 preceding siblings ...)
  2010-02-20  6:51 ` glenn at zewt dot org
@ 2010-02-20  9:01 ` pinskia at gmail dot com
  2010-02-20 15:31 ` manu at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gmail dot com @ 2010-02-20  9:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gmail dot com  2010-02-20 09:00 -------
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
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
                   ` (3 preceding siblings ...)
  2010-02-20  9:01 ` pinskia at gmail dot com
@ 2010-02-20 15:31 ` manu at gcc dot gnu dot org
  2010-02-20 15:56 ` manu at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-02-20 15:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from manu at gcc dot gnu dot org  2010-02-20 15:31 -------
(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.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
                   ` (4 preceding siblings ...)
  2010-02-20 15:31 ` manu at gcc dot gnu dot org
@ 2010-02-20 15:56 ` manu at gcc dot gnu dot org
  2010-02-22 22:31 ` manu at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-02-20 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from manu at gcc dot gnu dot org  2010-02-20 15:56 -------
I have a patch.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |manu at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-02-20 06:25:29         |2010-02-20 15:56:39
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
                   ` (5 preceding siblings ...)
  2010-02-20 15:56 ` manu at gcc dot gnu dot org
@ 2010-02-22 22:31 ` manu at gcc dot gnu dot org
  2010-02-22 22:32 ` manu at gcc dot gnu dot org
  2010-06-02  6:54 ` pzhao at gcc dot gnu dot org
  8 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-02-22 22:31 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1755 bytes --]



------- Comment #7 from manu at gcc dot gnu dot org  2010-02-22 22:31 -------
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


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
                   ` (6 preceding siblings ...)
  2010-02-22 22:31 ` manu at gcc dot gnu dot org
@ 2010-02-22 22:32 ` manu at gcc dot gnu dot org
  2010-06-02  6:54 ` pzhao at gcc dot gnu dot org
  8 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-02-22 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from manu at gcc dot gnu dot org  2010-02-22 22:32 -------
FIXED in GCC 4.5


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

* [Bug c++/43126] "at this point in file" warnings are upside down
  2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
                   ` (7 preceding siblings ...)
  2010-02-22 22:32 ` manu at gcc dot gnu dot org
@ 2010-06-02  6:54 ` pzhao at gcc dot gnu dot org
  8 siblings, 0 replies; 11+ messages in thread
From: pzhao at gcc dot gnu dot org @ 2010-06-02  6:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pzhao at gcc dot gnu dot org  2010-06-02 06:53 -------
*** Bug 38468 has been marked as a duplicate of this bug. ***


-- 

pzhao at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43126


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

end of thread, other threads:[~2010-06-02  6:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-20  5:22 [Bug c++/43126] New: "at this point in file" warnings are upside down glenn at zewt dot org
2010-02-20  6:25 ` [Bug c++/43126] " pinskia at gcc dot gnu dot org
2010-02-20  6:27 ` pinskia at gcc dot gnu dot org
2010-02-20  6:51 ` glenn at zewt dot org
2010-02-20  9:00   ` Andrew Pinski
2010-02-20  9:01 ` pinskia at gmail dot com
2010-02-20 15:31 ` manu at gcc dot gnu dot org
2010-02-20 15:56 ` manu at gcc dot gnu dot org
2010-02-22 22:31 ` manu at gcc dot gnu dot org
2010-02-22 22:32 ` manu at gcc dot gnu dot org
2010-06-02  6:54 ` pzhao at gcc dot gnu dot org

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).