【C】Pointer (8) Incomplete Type: About Void

※ 日本語ページはこちら

About Incomplete Type.

Incomplete type is described in “6.2.5 Types”, so I will explain Types in this article.

6.2.5 Types

The meaning of a value stored in an object or returned by a function is determined by the type of the expression used to access it. (An identifier declared to be an object is the simplest such expression; the type is specified in the declaration of the identifier.) Types are partitioned into object types (types that fully describe objects), function types (types that describe functions), and incomplete types (types that describe objects but lack information needed to determine their sizes).

ref: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf#page=45

Let’s condense.

Incomplete Type is the type which cannot determine size of object.

Below are example of incomplete type.

  • A void type
  • An array type of unknown size
  • A structure or union type of unknown content

Let’s investigate about void type.

The void type comprises an empty set of values; it is an incomplete type that cannot be completed.

ref: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf#page=47

In this context, value is used in the meaning which is defined below.

As I describe previously the definition incomplete type is below.

Incomplete Type is the type which cannot determine size of object.

If declared with void type, we cannot determine the size of object as far as the type is void type, therefore void type is one of incomplete types, this is my understanding.

That’s all for this time.