Issue 1009: extern thread_local should not be an external definition

Authors: Joseph Myers
Date: 2025-03-12
Submitted against: C23
Status: Open

The following issue was pointed out by Ori Bernstein in reflector message 25279.

C23 6.9.3 says:

If the declaration of an identifier for an object has file scope and an initializer, or has file scope and storage-class specifier thread_local, the declaration is an external definition for the identifier.

This fails to allow for the combination extern thread_local, which should not be an external definition.

Suggested correction

In C23 6.9.3, amend the quoted paragraph as follows:

If the declaration of an identifier for an object has file scope and an initializer, or has file scope and storage-class specifier thread_local without extern, the declaration is an external definition for the identifier.