Package: manpages-dev
Version: 2.62-1
Severity: normal
Tags: patch

The longjmp(3) function may cause unexpected things to happen to local
varables modified after the call to setjmp().  I've encountered this
issue several times, so it seems worthy of a mention in the manpage.

Attached patch adds this, using wording similar to the POSIX spec.

Paul

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.20-1-xen-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages manpages-dev depends on:
ii  manpages                      2.62-1     Manual pages about using a GNU/Lin

manpages-dev recommends no packages.

-- no debconf information
diff -ur clean/man3/longjmp.3 manpages-2.62/man3/longjmp.3
--- clean/man3/longjmp.3        2007-05-18 09:43:42.000000000 +0100
+++ manpages-2.62/man3/longjmp.3        2007-09-04 18:29:23.000000000 +0100
@@ -85,6 +85,21 @@
 If you want to save and restore signal masks, use
 .BR siglongjmp ().
 .P
+The values of objects of automatic storage durations are unspecified after
+the call to
+.BR longjmp ()
+if they meet all the following criteria:
+.IP \(bu
+They are local to the function containing the corresponding
+.BR setjmp ()
+invocation.
+.IP \(bu
+They do not have volatile-qualified type.
+.IP \(bu
+They are changed between the setjmp() invocation and
+.BR longjmp ()
+call.
+.P
 .BR longjmp ()
 and
 .BR siglongjmp ()

Reply via email to