Title
Longjmp wording problem
Status
cd1
Section
[support.runtime]
Submitter
Lawrence Crowl

Created on 2007-01-12.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In general, accept Bill Gibbons' recommendation, but add "call" to indicate that the undefined behavior comes from the dynamic call, not from its presence in the code. In [support.runtime] paragraph 4, change

The function signature longjmp(jmp_buf jbuf, int val) has more restricted behavior in this International Standard. If any automatic objects would be destroyed by a thrown exception transferring control to another (destination) point in the program, then a call to longjmp(jbuf, val) that the throw point that transfers control to the same (destination) point has undefined behavior. A setjmp/longjmp call pair has undefined behavior if replacing the setjmp and longjmp by catch and throw would destroy any automatic objects.

Date: 2007-01-12.00:00:00

The wording for longjmp is confusing.

[support.runtime] -4- Other runtime support

The function signature longjmp(jmp_buf jbuf, int val) has more restricted behavior in this International Standard. If any automatic objects would be destroyed by a thrown exception transferring control to another (destination) point in the program, then a call to longjmp(jbuf, val) that the throw point that transfers control to the same (destination) point has undefined behavior.

Someone at Google thinks that should say "then a call to longjmp(jbuf, val) *at* the throw point that transfers control".

Bill Gibbons thinks it should say something like "If any automatic objects would be destroyed by an exception thrown at the point of the longjmp and caught only at the point of the setjmp, the behavior is undefined."

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3236
2007-01-12 00:00:00admincreate