This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: jmp_buf size?
- From: Jay <jay dot krell at cornell dot edu>
- To: cygwin <cygwin at cygwin dot com>
- Date: Wed, 4 Feb 2009 23:00:00 +0000
- Subject: RE: jmp_buf size?
What is up with the size of jmp_buf?
It appears that setjmp.h confuses bytes and ints, specifically in the Cygwin case.
_JBLEN should be 13, not 13*4.
or #define _JBTYPE to char, but that doesn't work as easily.
?
I applied a local hack workaround, something like:
typedef unsigned char JBTYPE __attribute(align(4));
#define _JBTYPE _JBTYPE
#include
Though my larger goal, of implementing (deprecated-in-favor-of-pthreads) Posix get/make/set/swapcontext I gave up on anyway, at least via layering over setjmp/longjmp. They may be implementable via Win32 fibers, though the overall thing still perhaps dodgy and useless ("user more threads"...).
I realize that jmp_buf is something "deep" and system specific, not to be messed with lightly, but I'm also pretty darn certain that Cygwin declares its own jmp_buf incorrectly.
I also realize that larger than needed is safe, "just" wasteful, and possibly "future proof".
It still seems like a mistake.
- Jay
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/