On 12/14/06, Earnie Boyd <[EMAIL PROTECTED]> wrote:
> Quoting Andreas Schwab <[EMAIL PROTECTED]>:
>
> > "Bruce Korb" <[EMAIL PROTECTED]> writes:
> >
> >> It seems awfully bizarre that POSIX disallows the portability of
> >> capturing the value given to siglongjmp().  It is very counter
> >> intuitive.
> >
> > (sig)setjmp is very special because it returns twice.  Thus [...]
> >
> > For sigsetjmp POSIX just copied the restrictions that the C standard
> > places on setjmp.
>
> You might be able to store the value of setjmp in the environment and
> then grab the value from the environment after the longjmp.  Cygwin
> does this in its fork emulation but YMMV on various systems.

"YMMV" is the genesis of the entire problem.  I read the Solaris spec on
sigjmp stuff over a decade ago, and the mileages have varied.  And don't
get me started on pointer aliasing.  ;)  The best I can do is try to follow
POSIX and hope the next standard does not invalidate those presumptions.
So, my next release will likely always use sigsetjmp() inside a switch.
That is explicitly allowed by POSIX:

  http://www.opengroup.org/onlinepubs/007908799/xsh/sigsetjmp.html
     An invocation of sigsetjmp() must appear in one of the following
contexts only:
         * the entire controlling expression of a selection or
iteration statement

Cheers - Bruce

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Autogen-users mailing list
Autogen-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/autogen-users

Reply via email to