<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Misuse of setjmp in DCTStream"
href="https://bugs.freedesktop.org/show_bug.cgi?id=63067#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Misuse of setjmp in DCTStream"
href="https://bugs.freedesktop.org/show_bug.cgi?id=63067">bug 63067</a>
from <span class="vcard"><a class="email" href="mailto:rodrigorivascosta@gmail.com" title="rodrigo <rodrigorivascosta@gmail.com>"> <span class="fn">rodrigo</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=63067#c1">comment #1</a>)
<span class="quote">> The man page I have here does not say that, do you have a link to the POSIX
> or C spec at hand?</span >
You can read what POSIX says at [0].
The C99 specification is at [1] (section 7.3.1.1) but the wording is almost
identical, as this function is 'ISO C aligned'.
Also, many linux distributions have a package named manpages-posix or the like.
If you have it installed you can request the POSIX version of the man page by
running:
$ man 3p setjmp
But now that I read the 'longjmp(3p)' [2] with more detail, I think that there
are bigger problems ahead... Note the following quote:
<span class="quote">> if [when calling longjmp] the function containing the invocation of setjmp() has terminated execution [...] the behavior is undefined.</span >
And I think that this happens a lot, as `setjmp` is called from a lot of helper
functions. I think that the right thing to do should be to call it only once at
the beginning of the main decompression function. The problem is that such a
call cannot be encapsulated into the DCTStream class, it had to be done from
the user code, and that is not very nice.
[0]: <a href="http://pubs.opengroup.org/onlinepubs/009696799/functions/setjmp.html">http://pubs.opengroup.org/onlinepubs/009696799/functions/setjmp.html</a>
[1]: <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf</a>
[2]: <a href="http://pubs.opengroup.org/onlinepubs/009696799/functions/longjmp.html">http://pubs.opengroup.org/onlinepubs/009696799/functions/longjmp.html</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>