https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95103
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Richard's explanation in comment #1 is correct. The compiler assumes any
external call in the destructor can transfer control back to setjmp.
In principle in this case the warning is avoidable by observing that jmp_buf is
local and does not escape, but for any other returns_twice function the problem
would remain, as there's no jmp_buf-like key to track (think vfork).
(iow: solving this would need special-casing warning code for setjmp, which
currently works the same for all functions with the returns_twice attribute)
Let's close this?