Issue 1032: errno as a bit-field

Authors: Jay Ghiron
Date: 2026-03-13
Submitted against: C23
Status: Open

No wording exists currently to say that errno cannot expand to a bit-field lvalue that has type int:

The macros are

...

errno

which expands to a modifiable lvalue that has type int and thread storage duration,

(C23 7.5 "Errors <errno.h>" paragraph 2.)

Additionally it does not forbid register from being used, though that is exclusive with thread storage duration. If it were allowed to be a bit-field expression or use register, then &errno would be invalid. The wording for errno also says that the lvalue itself has thread storage duration, rather than the object which it refers to. This is inconsistent with the rest of the standard which uses storage duration as a property of objects, rather than of expressions.

Suggested correction

Modify C23 7.5 paragraph 2:

errno

which expands to a modifiable lvalue that has type int and thread storage durationwherein the designated object has thread storage duration, is not a bit-field, and is not declared with the register storage-class specifier,