This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Decorate C prototypes
- From: Martin Sebor <sebor at roguewave dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>, Jan Hubicka <hubicka at ucw dot cz>, libstdc++ at gcc dot gnu dot org
- Date: Fri, 01 May 2009 10:38:15 -0600
- Subject: Re: Decorate C prototypes
- References: <20090422160718.GA30574@kam.mff.cuni.cz> <49EF5323.3080203@oracle.com> <49F0CF4A.7050805@codesourcery.com>
Mark Mitchell wrote:
[...]
2. We should verify that the compiler accepts
extern "C" void abort(void);
namespace std {
extern "C" void abort(void) throw();
}
and:
namespace std {
extern "C" void abort(void) throw();
}
extern "C" void abort(void);
That's important in case a user explicitly declares the function, or
#include's the C header.
gcc 4.3.1 (the latest I have access to at the moment) does accept
this even though it's ill-formed according to [except.spec], p2:
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.
Bugs 32081 and 24817 look like they might be related to this
problem:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32081
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24817
Martin