|
From: Tom H. <to...@co...> - 2010-12-10 18:09:24
|
On 10/12/10 17:50, Maynard Johnson wrote: > The generated code is apparently incorrect, but we got no joy when our resident gcc person reported this to other gcc community folk. We were told that these functions are for internal gcc use only -- and also that doing a longjmp out of a signal handler is "undefined" by the POSIX standard. So far, I've only seen problems occur in cases where the longjmp is performed out of a signal handler. My reading of POSIX is that it is well defined to longjmp from a signal handler so long as it is not a nested signal handler. See here: http://www.opengroup.org/onlinepubs/009695399/functions/longjmp.html Specifically the paragraph which says: "As it bypasses the usual function call and return mechanisms, longjmp() shall execute correctly in contexts of interrupts, signals, and any of their associated functions. However, if longjmp() is invoked from a nested signal handler (that is, from a function invoked as a result of a signal raised during the handling of another signal), the behavior is undefined. Tom -- Tom Hughes (to...@co...) http://compton.nu/ |