Is "void" a scalar type?
From the C18 standard (6.2.5 §21) :
Arithmetic types and pointer types are collectively called scalar types.
void
is neither an arithmetic type, nor a pointer type, so it's not a scalar type.
From 6.2.5 §19 :
The
void
type comprises an empty set of values; it is an incomplete object type that cannot be completed.
The type void
is not considered a scalar type. It is actually an incomplete type.
Section 6.2.5 of the C standard regarding "Types" states the following regarding void
in paragraph 19:
The
void
type comprises an empty set of values; it is an incomplete object type that cannot be completed.
And paragraph 21 defines scalar types as:
Arithmetic types and pointer types are collectively called scalar types. Array and structure types are collectively called aggregate types.
It is a special type category of its own. It is not a scalar type, but an incomplete type that you cannot declare an instance of.
From C17 6.2.5:
§18
Integer and floating types are collectively called arithmetic types.
§19
The
void
type comprises an empty set of values; it is an incomplete object type that cannot be completed.
§21
Arithmetic types and pointer types are collectively called scalar types.