This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Remove -fexceptions configure test
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 15 Oct 2015 23:28:49 +0000
- Subject: Re: Remove -fexceptions configure test
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1510152146440 dot 6002 at digraph dot polyomino dot org dot uk> <20151015215813 dot EAB7F2C3C0C at topped-with-meat dot com>
On Thu, 15 Oct 2015, Roland McGrath wrote:
> What is the reason for -fexceptions in all those other places? If
> each is actually a uses-callbacks case, then we should use that
> variable to clarify that in the documentation. I think that's the
> actual case for all the stdio cases, because they can lead to
> callbacks via _IO_JUMPS.
>
> Do we have any -fexceptions cases that are not actually uses-callbacks?
I think:
* If a function may be cancelled, it needs -fexceptions. This includes
most functions doing I/O unless explicitly using non-cancellable I/O
functions.
* If the cancellation may occur from within an inline asm, not just at
function call points, -fasynchronous-unwind-tables is needed as well.
(I'm not sure what's going on with the few files using
-fasynchronous-unwind-tables without -fexceptions.)
* If a function uses callbacks, it needs -fexceptions (both because the
callbacks might use interfaces that can be cancelled, and also because
they might throw exceptions).
* For all of the above, __THROW must not be used.
More than one of the above may apply to a function. I don't know what
makes sense regarding makefile variables in such cases (I/O and callbacks,
for example). And I don't know if we actually intend to allow exceptions
to be thrown and cancellation to occur for arbitrary callbacks.
(snprintf is marked __THROWNL - but custom printf handlers can be
registered.)
--
Joseph S. Myers
joseph@codesourcery.com