|
From: Tom H. <to...@co...> - 2010-12-15 17:33:02
|
On 15/12/10 17:23, Maynard Johnson wrote: > The gcc guy I talked to pointed me at http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_152.html, which is a bug report about unclear/conflicting documentation involving [set|long]jmp and signal. The end result of that bug is this statement: > > "The C Standard is clear enough as is. The longjmp function shall execute correctly when called from a non-nested signal handler invoked through calls to the raise or abort functions; if longjmp is called from a signal handler invoked by other means, or from a nested signal handler, the behavior is undefined". POSIX can, and does, go beyond what the C standard requires/allows though, so the C standard is not necessarily the end of it. Indeed the "CX" marker beside the paragraph I quoted means precisely that the requirement in question is an extension to the ISO C standard. Jumping out of signal handlers with longjmp is a very common thing to do because it is one of the few things that it is generally considered safe to do in signal handlers and my understanding had always been that even if the C standard didn't allow it, POSIX did. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |