Authors: Jay Ghiron
Date: 2026-04-23
Submitted against: C23
Status: Open
The following text has not been changed since initial standardization:
The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature.
(C23 6.11.5 "Storage-class specifiers" paragraph 1.)
Originally it was not valid to use two or more storage-class specifiers in a declaration. Now it is possible to use even three storage-class specifiers:
constexpr static auto x=0;
static thread_local auto y=0;
There is no order here that is not considered obsolescent. Additionally, using alignment specifiers before storage-class specifiers is useful in the context of headers compatible with C and C++:
alignas(alignof(int)*2)extern int z;
The non-obsolescent ways to write this declaration are:
extern alignas(alignof(int)*2)int z;
Or, alternatively:
extern int alignas(alignof(int)*2)z;
But only the obsolescent declaration is also valid in C++, which has
alignas grammatically as an attribute rather than a declaration
specifier. This means that it is even valid to put alignas after
the identifier:
extern int z alignas(alignof(int)*2);
With the style of "east const" being common the following is also
not so unreasonable:
int constexpr c=0;
Lastly, since auto is currently a storage-class specifier the style
of "const west" with auto is considered obsolescent:
const auto d=0;
This applies to the other qualifiers as well, including _Atomic. It
seems unnecessary to obsolete this commonly used style when used in
combination with auto.
Should using multiple storage-class specifiers be obsolescent?
Should using alignment specifiers before storage-class specifiers be obsolescent?
If the answer to question two is that it should not be obsolescent, should compound literals be allowed to also put alignment specifiers before storage-class specifiers? This is currently forbidden by the syntax of compound literals. There is no motivation to allow this aside from consistency.
Should using "east const" with constexpr be obsolescent? That is,
putting constexpr after the type specifiers.
If the answer to question four is that it should not be obsolescent,
should compound literals be allowed to also put constexpr after the
type specifiers? This is currently forbidden by the syntax of
compound literals.
Should using "const west" with auto be obsolescent? That is,
putting const before auto.