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/36024] New: Incorrect function name in linking error


gcc compiler does not give the correct function name in error

test case::

struct abc
{
  int xx;
};

extern void *__nw__FUi (unsigned);
extern struct abc *__ct__3abcFv (struct abc *);

int
main (void)
{
  auto struct abc obj;
  __ct__3abcFv ((&obj));
  return (obj.xx);
}

struct abc *
__ct__3abcFv (struct abc *this)
{
  if ((this != ((struct abc *) 0))
      || ((this = ((struct abc *) (__nw__FUi (4U)))) != ((struct abc *) 0)))
    {
      (this->xx) = 1;
    }
  return this;
}


output:
/tmp/cc00HPTT.o: In function `abc::__ct(void)':
tt2.c:(.text+0x3c): undefined reference to `operator new(unsigned int)'
collect2: ld returned 1 exit status

__ct function does not exists in the input test case.
why it is doing such


But when we change the name of function in the input program __ct__3abcFv to
any other name 
then it gives the correct function name in error message.


-- 
           Summary: Incorrect function name in linking error
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ashutosh dot nema at nechclst dot in


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


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