thrd_t as an array typeAuthors: Jay Ghiron
Date: 2026-02-27
Submitted against: C23
Status: Open
Cross-references: 1058
No wording exists currently to say that thrd_t is not an array type:
The types are
...
thrd_twhich is a complete object type that holds an identifier for a thread;
(C23 7.28.1 "Introduction" paragraph 4).
However, the definition of thrd_current returns a thrd_t:
thrd_t thrd_current(void);
(C23 7.28.5.2 "The thrd_current function" paragraph 1).
Functions are not allowed to return arrays, so if thrd_t were an
array type then this declaration would be invalid.
Modify C23 7.28.1 paragraph 4:
thrd_twhich is a complete object type other than an array type that holds an identifier for a thread;
Comment from Issues list maintainer on 2026-08-21:
This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
It was suggested that, rather than array types being excluded
individually in particular cases, the general wording about library
types should exclude them by default, with only a few specific cases
such as jmp_buf and va_list allowing them. Joseph Myers took an
action item to propose wording for this (building on the wording for
issue 1025).
Comment from Issues list maintainer on 2026-08-25:
In reflector message 37708, Joseph Myers provided an analysis of which standard library types are not currently excluded from being array types.