This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Decorate C prototypes
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, libstdc++ at gcc dot gnu dot org
- Date: Thu, 23 Apr 2009 13:27:54 -0700
- Subject: Re: Decorate C prototypes
- References: <20090422160718.GA30574@kam.mff.cuni.cz> <49EF5323.3080203@oracle.com>
Paolo Carlini wrote:
> Excellent. I just wonder, running a libc != glibc cannot cause any
> problem, for sure?!?
I do not think it should cause any problems. A C library that throws
exceptions from these functions is a very odd C library indeed, given
that C libraries aren't supposed to throw exceptions.
I see two minor issues:
1. With -fnon-call-exceptions, I think we should assume that these
functions might throw exceptions. I guess this is probably a big
pre-existing problem, so probably not something we need to fix here. I
think the fix is to turn "throw()" into "_GLIBCXX_NOTHROW" and then make
that expand to empty when -fnon-call-exceptions is in use.
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.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713