This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Your g++ breaks glibc.
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Your g++ breaks glibc.
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 15 Jul 1999 01:23:02 -0600
- cc: hjl at varesearch dot com, jason at cygnus dot com, egcs-patches at egcs dot cygnus dot com, libc-hacker at sourceware dot cygnus dot com, bje at cygnus dot com
- Reply-To: law at cygnus dot com
In message <19990714233738F.mitchell@codesourcery.com>you write:
> The code is indeed buggy:
>
> [except.spec]
>
> If any declaration of a function has an exception-specification, all
> declarations, including the definition and an explicit specialization,
> of that function shall have an exception-specification with the same
> set of type-ids.
>
> It couldn't be any clearer.
>
> If autoconf is generating the code fragment H.J. shows, then autoconf
> is broken.
>
> However, the patch should still go on the branch. After all, autoconf
> is in widespread use. There is no non-conformance issue here since we
> will still warn if -pedantic.
How about branch only? I'm not as wired into the C++ community as you or
Jason, but one of the things that comes up often when I talk to C++ folks is
the desire for the compiler to follow the standard as strictly as possible
in its default mode. Just a datapoint to consider.
I'll go ahead and install the patch on the branch and let you and Jason make
a decision about the mainline tree for this one.
> H.J., please follow up with whatever tool is producing this bogus
> code, and get that tool fixed. In the next major version, we should
> make this a warning, even without -pedantic. In the next major
> version after that, we should probably disallow this usage, period.
It appears to be autoconf that's creating the bogon exit declaration for
its test. I've cc'd Ben, so hopefully he'll have some opinions on the
feasibility of fixing autoconf.
Ben -- the problem appears to be that autoconf generates this code fragment,
then tries to compile it:
extern "C" {
void exit (int);
};
#include <stdlib.h>
According to the C++ folks that's invalid code.
I just peeked at the autoconf CVS sources and it doesn't look like this has
been changed/fixed, so I believe it is still an open issue.
jeff