Article View: gnu.g++.bug
Article #806Re: g++ and groff's c++test.c
From: Mike Stump
Date: Sat, 29 Aug 1992 12:35
Date: Sat, 29 Aug 1992 12:35
53 lines
1732 bytes
1732 bytes
I suspect you probably already have this fixed, but incase not...
The installation of the compiler was someone messaged up. You need to
make sure that either GNU ld is installed and used by the compiler or
that collect (collect2.c) is build and used by the compiler.
This problem has nothing to do with the optimizer.
> Date: Tue, 11 Aug 92 00:03:17 PDT
> From: gregor@kafka.saic.com (gregg hanna)
> Message-Id: <9208110703.AA19545@kafka.saic.com>
> I was trying to build groff but it didn't pass the c++
> compiler test in c++test.c, which is:
> #include <stdio.h>
> struct A {
> A() { fputs("A\n", stdout); }
> ~A() { fputs("~A\n", stdout); }
> };
> A a;
> main()
> {
> return 0;
> }
> I thought maybe the optimizer trashed it, but I tried it
> several different ways. It appears that g++ does not call
> the creator for statically declared variables. Is this
> correct behavior? The following, however, works fine:
> #include <stdio.h>
> struct A {
> A() { fputs("A\n", stdout); }
> ~A() { fputs("~A\n", stdout); }
> };
> main()
> {
> A a;
> return 0;
> }
> If this is not a bug, perhaps the groff people should
> be notified, since groff-1.05 currently will not compile
> if it fails the c++test. By the way, the groff people
> expect the output of the program to be:
> A
> ~A
Technical Details
Message-ID:
<9208291235.AA28387@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: g++ and groff's c++test.c Message-ID: <9208291235.AA28387@cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 29 Aug 1992 12:35:31 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 54