This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56723] New: wrong location in error message


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

             Bug #: 56723
           Summary: wrong location in error message
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tromey@gcc.gnu.org


Consider this source file:

int f (int *);

int callf (int, int, int (*)(double *));

int docall(void)
{
  return callf (23, 72,
        f);
}


Compiling this with g++ yields:

t.cc: In function âint docall()â:
t.cc:8:4: error: invalid conversion from âint (*)(int*)â to âint (*)(double*)â
[-fpermissive]
   f);
    ^
t.cc:3:5: error:   initializing argument 3 of âint callf(int, int, int
(*)(double*))â [-fpermissive]
 int callf (int, int, int (*)(double *));
     ^


Note that "8:4" location.
I think this is slightly off.

The C compiler gets it ok:

barimba. gcc -g --syntax-only t.c
t.c: In function âdocallâ:
t.c:8:3: warning: passing argument 3 of âcallfâ from incompatible pointer type
[enabled by default]
(etc)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]