Article View: gnu.g++.bug
Article #1691Bug with undefined types
From: "Robert S. French"
Date: Mon, 20 Feb 1989 05:56
Date: Mon, 20 Feb 1989 05:56
37 lines
1379 bytes
1379 bytes
In g++ 1.32.0 on a BSD 4.3 VAX:
A file such as the following:
struct foo {
bar *baz;
};
main(int argc, char *argv[])
{
cout << "Hi!\n";
}
causes g++ to completely ignore the file after the reference to the
undeclared type "bar". No error message is printed, and an object
file is generated (containing very little). For example:
136% g++ -v /tmp/foo.cc
g++ version 1.32.0
/mit/gnu/vaxlib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix /tmp/foo
.cc /tmp/cc000244.cpp
GNU CPP version 1.33
/mit/gnu/vaxlib/gcc-c++ /tmp/cc000244.cpp -quiet -dumpbase /tmp/foo.cc -noreg -
version -o /tmp/cc000244.s
GNU C++ version 1.32.0 (vax) compiled by GNU C version 1.32.
/mit/gnu/vaxlib/gcc-as /tmp/cc000244.s -o foo.o
/mit/gnu/vaxlib/gcc-ld++ -C /mit/gnu/vaxlib/gcc-crt0+.o foo.o -lg++ /mit/gnu/va
xlib/gcc-gnulib -lc
Undefined symbols:
_main
If "bar" is declared before the structure definition, the file works
fine.
Rob
Technical Details
Message-ID:
<8902200556.AA00249@BINKLEY.MIT.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!rfrenchShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!rfrench
From: rfrench@ATHENA.MIT.EDU ("Robert S. French")
Newsgroups: gnu.g++.bug
Subject: Bug with undefined types
Message-ID: <8902200556.AA00249@BINKLEY.MIT.EDU>
Date: 20 Feb 89 05:56:38 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 37