"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 it needs
compiler support to do it right wrt. register allocation.  For example,
the compiler may load (part of) the address of the variable that should
hold the return value of (sig)setjmp in a callee saved register.  On the
second return the register contents may already have been overwritten by
the code that was executed after the first return (longjmp may not restore
all register contents), causing the subsequent store to go to lala land.

For sigsetjmp POSIX just copied the restrictions that the C standard
places on setjmp.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

-------------------------------------------------------------------------
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