This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Using __chk_fail from libstdc++
> It can be
> namespace __gnu_cxx
> {
> extern "C" void __chk_fail () __attribute__((noreturn));
> };
> ...
> __gnu_cxx::__chk_fail ();
> on the libstdc++ side IMHO (or some other appropriate namespace).
That means libstdc++ would have to provide a wrapper that's just a
tail-call to libc's __chk_fail, right? That seems fine to me, but
Florian said he prefers to avoid a wrapper.
All in all, this does seem like the best idea to me. Having libstdc++
headers refer to libstdc++ internal symbols rather than libc internal
symbols just seems like the wise thing. We certainly don't care about
microoptimizing crashing cases, so the extra bounce through a tail call
is not something to fret about.
Thanks,
Roland