Article View: gnu.g++.bug
Article #812Re: Gnu C++ bugs in classes
From: Mike Stump
Date: Sat, 29 Aug 1992 13:08
Date: Sat, 29 Aug 1992 13:08
45 lines
2489 bytes
2489 bytes
The code you give is not valid C++ code, I believe. Please cite ARM
if you think it is valid C++.
> Message-Id: <MAILQUEUE-101.920819095701.745@fs1.metallurgy.umist.ac.uk>
> From: A.APPLEYARD@fs1.mt.umist.ac.uk
> Date: 19 Aug 92 09:57:01 GMT
> BUG REPORT:
> Gnu C version 2.0 compiled etc and linked this program OK (as 'gcc t$$$.cc'):-
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> class scubadiver_catcher{public:
> int i,j,k,l;
> void call_into_action(char*s){j=strlen(s);};
> void scubadiver_catcher::radio_for(char*s){k=strlen(s);};};
> scubadiver_catcher Aphanistor;
> main(){
> Aphanistor.call_into_action("5 seen at Long Cove");
> Aphanistor.radio_for("12 in 2 boats offshore from Black Rock Head");}
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> But if I compiled it in 2 parts, as 'gcc t$$$1.cc t$$$2.cc':-
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> <<file t$$$1.cc>>
> class scubadiver_catcher{public:
> int i,j,k,l;
> void call_into_action(char*s){j=strlen(s);};
> void scubadiver_catcher::radio_for(char*s){k=strlen(s);};};
> void dummy(){}
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> <<file t$$$2.cc>>
> class scubadiver_catcher{public:
> int i,j,k,l;
> void call_into_action(char*s);
> void scubadiver_catcher::radio_for(char*s);};
> scubadiver_catcher Aphanistor;
> main(){
> Aphanistor.call_into_action("5 seen at Long Cove");
> Aphanistor.radio_for("12 in 2 boats offshore from Black Rock Head");}
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> the linker said this:-
> t$$$2.o: Undefined symbol scubadiver_catcher::call_into_action(char *) reference
> d from text symbol
> Note that '_call_into_action__18scubadiver_catcherPc:' is not declared as global
> in assembler file t$$$1.s as produced bu Gnu C++ version 2.0 .
> This bug was not present in the last version of Gnu C which I had (1.39?).
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID:
<9208291308.AA28674@cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrsShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs From: mrs@cygnus.com (Mike Stump) Subject: Re: Gnu C++ bugs in classes Message-ID: <9208291308.AA28674@cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 29 Aug 1992 13:08:09 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 46