jmp_buf as an incomplete array typeAuthors: Jay Ghiron
Date: 2026-03-03
Submitted against: C23
Status: Review
No wording exists currently to say that jmp_buf must be a complete
object type:
The type declared is
jmp_bufwhich is an array type suitable for holding the information needed to restore a calling environment.
(C23 7.13.1 "Non-local jumps" paragraph 3.)
If jmp_buf were an incomplete object type, this would break almost
all uses of it. Interestingly, the example of longjmp in C23
7.13.3.1 paragraph 5 would be fine because it defines an object of
type jmp_buf by using a tentative definition.
Modify C23 7.13.1 paragraph 3:
jmp_bufwhich is a complete object type that is an array type suitable for holding the information needed to restore a calling environment.
Note: This wording is suggested instead of "complete array type" to
clarify that jmp_buf must have a fundamental alignment requirement.
Comment from Issues list maintainer on 2026-08-21:
At the August 2026 (Ottawa) meeting of WG14, a modified version of the suggested correction was accepted (noting that issue 1058 should be responded to in a way such that "complete array type" is sufficient to guarantee a fundamental alignment requirement), subject to review at the next meeting.
Modify C23 7.13.1 paragraph 3:
jmp_bufwhich is
ana complete array type suitable for holding the information needed to restore a calling environment.