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: confusing diagnostics


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

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