This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: confusing diagnostics
- To: Ulrich dot Lauther at mchp dot siemens dot de
- Subject: Re: confusing diagnostics
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 11 Jan 2001 15:58:58 +0100
- Cc: gcc at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <200101111352.f0BDq3b12345@emma.mchp.siemens.de>
Ulrich Lauther <ulrich.lauther@mchp.siemens.de> writes:
| This (syntactically wrong) code gives rather confusing error reports:
|
| class foo {
| int fudge;
| public:
| foo(int x) : fudge(x) {
| }
| virtual void do_something();
| };
|
| class bar : public foo {
| public:
| bar(int x) : foo(x) {
| }
| void do_something() {
| }
| };
|
| int main() {
| bar(0);
| return 0;
| }
|
|
| Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/2.95.1/specs
| gcc version 2.95.1 19990816 (release)
| [ stuff deleted ]
| /tmp/ccRtcD7X.o: In function `bar type_info function':
| /tmp/ccRtcD7X.o(.gnu.linkonce.t.__tf3bar+0x10): undefined reference to `foo type_info function'
I think we've been through this in the past. What the compiler+linker
is attempting to say is that some virtuals were undefined.
Giiven current virtuals implementation, we need sophistication at the
linker level to precisely which virtual functions were missing.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com