This is the mail archive of the gcc@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]

Re: collect2 / ld giving strange errors with undefined virtual functions


> Yup.  But this error is impossible to detect within the compiler, and
> when we get to the linker, it's too late :-(

Would it be worth to introduce another linker feature here. GNU ld
already has the linker_warning: a message is printed whenever a
specific symbol definition is used. glibc uses it to warn about calls
to unreliable functions.

The feature I'm proposing is different: Whenever the linker ends up
with an undefined symbol, it will print a message like

undefined reference to `A virtual table'
There is no definition of `A::foo(int)'.

What do you think?

Martin



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