First of all, quoting from §6.11.5, "Future language directions"
1 The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature.
So, do not rely on this, as it may be removed in the future.
That said, to understand why this works, check the C11 standard, chapter §6.7.2:
[...] the type specifiers may occur in any order, possibly
intermixed with the other declaration specifiers.
From §6.7.1, we know typedef
is a storage-class specifier (one particular sort of a declaration specifier), so it can be placed after (or before) the type specifier (i.e., can be intermixed). It does not change anything.
int short static someVar;
is also valid, right? – Assuantypedef
is a "storage-class" to find the dupe effectively. – Conklintypedef
is just a storage class specifier likeextern
orstatic
, so it can be intermixed with the type declarator. – Gauze