From: Kalle Olavi Niemitalo <[EMAIL PROTECTED]>
Date: 10 May 2000 10:03:52 +0300
According to the glibc manual, the result of setjmp must not be
assigned like diskfs_catch_exception does: it must be either
immediately used in a do/while/for/if/switch statement or
ignored. Has GCC relaxed this restriction?
It looks to me that there is no problem with assigning the result of
setjmp for the Hurd. Since setjmp() is just a macro that calls
__sigsetjmp(), we're simply assigning the return value of a function.
Since that return value is guaranteed to be in the %eax register,
regardless of whether that return was the result of a non-local goto
or not, doesn't matter.
Of course this isn't portable. There may be implementations that put
additional restrictions on the use of setjmp(). ISO C allows setjmp()
to be implemented as a macro, which means that the argument above
doesn't have to apply. That's probably why the manual mentions those
restrictions.
However, for the Hurd servers themselves, it is not too bad to make
some additional assumptions about implementation details if that is
convenient or improves performance.
Mark