This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Decorate C prototypes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]