setjmp() shall be a macro according to C standard
commit91e22dcf5c44d908b24ae2bcd292787f0a7b8d96
authorVojtech Horky <vojtechhorky@users.sourceforge.net>
Fri, 15 Nov 2013 08:39:36 +0000 (15 09:39 +0100)
committerVojtech Horky <vojtechhorky@users.sourceforge.net>
Fri, 15 Nov 2013 08:39:36 +0000 (15 09:39 +0100)
tree6e40d931e1b4f766958e749949d33d93ba753fe6
parent8797bae1cfd5fa5ca11764060af285fe3fa72ceb
setjmp() shall be a macro according to C standard

As a matter of fact, when it is a function, the context that was
saved may no longer exist. Excerpt from IRC follows:

vhotspur: jermar, hi: what makes you think setjmp needs to be macro
vhotspur: hmmmm, C99 states that setjmp is macro and longjmp is function,
POSIX states that setjmp can be either macro or function
jermar: from what we have learned about context_save over the years
jermar: you basically capture the stack pointer in context_save()
jermar: if it is a function, you immediately deallocate part of that stack
jermar: so later to return to something which has once been a stack,
but is not anymore
jermar: for instance, you could expect to find the return address from
the call to setjmp() on it, but that could have been overwritten
by some further use of the stack

Also fixed bad definition of buffer type.
uspace/lib/c/generic/setjmp.c
uspace/lib/c/include/setjmp.h