Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Sep 1998 02:20:31 +0200 (MET DST)
From:      Jean-Marc Zucconi <jmz@FreeBSD.ORG>
To:        fn@radio-do.de
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Bug in elf c++
Message-ID:  <199809190020.CAA00821@qix>
In-Reply-To: <19980918190509.A2708@radio-do.de> (message from Frank Nobis on Fri, 18 Sep 1998 19:05:09 %2B0200)

next in thread | previous in thread | raw e-mail | index | archive | help
I tried the example and it exits with value 0 in both cases. Is your
c++ /usr/bin/c++ ?

Jean-Marc

>>>>> Frank Nobis writes:

 > Taken from the configure script of groff, I found a bug in the elf
 > version of c++.

 > Here is the example:

 > #ifdef __cplusplus
 > extern "C" void exit(int);
 > #endif

 > extern "C" {
 >   void _exit(int);
 > }
 > int i;
 > struct A {
 >   char dummy;
 >   A() { i = 1; }
 >   ~A() { if (i == 1) _exit(0); }
 > };
 > volatile A a;
 > int main() { return 1; }

 > Compile it with 'c++ -aout' and the exit value is 0.
 > Compile it just with 'c++' and the exit value is 1!

 > This leads to a bug in the groff package. Since the constructors
 > for some global class instances are not called, the default value
 > for font_path is not set and therefore groff fails to format any
 > man page.

-- 
 Jean-Marc Zucconi                    PGP Key: finger jmz@FreeBSD.ORG

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809190020.CAA00821>