diff --git a/share/man/man7/sizeof.7 b/share/man/man7/sizeof.7 --- a/share/man/man7/sizeof.7 +++ b/share/man/man7/sizeof.7 @@ -35,7 +35,17 @@ .br .Nm Vt expression .Sh DESCRIPTION -The size of primitive data types in C may differ +The +.Nm +operator yields the size of its operand. +The +.Nm +operator cannot be applied to incomplete types and expressions +with incomplete types (e.g. +.Vt void ), +and function types. +.Pp +The size of primitive (non-derived) data types in C may differ across hardware platforms and implementations. It may be necessary or useful for a program to be able to determine the storage size of a data type or object. @@ -44,8 +54,11 @@ .Nm operator yields the storage size of an expression or data type in -.Em char sized units . -As a result, 'sizeof(char)' is always guaranteed to be 1. +.Em char sized units +(C language bytes). +As a result, +.Ql sizeof(char) +is always guaranteed to be 1. (The number of bits per .Vt char is given by the @@ -73,8 +86,7 @@ .Pp When applied to a simple variable or data type, .Nm -returns the storage size of the data type of the -object: +returns the storage size of the data type of the object: .Bl -column -offset indent \ ".Li sizeof(struct flex)" ".Sy Result (ILP32)" ".Sy Result (LP64)" .It Sy Object or type \ @@ -129,7 +141,7 @@ .Pp When applied to a struct or union, .Nm -returns the total number of units in the object, +returns the total number of bytes in the object, including any internal or trailing padding used to align the object in memory. This result may thus be larger than if the storage @@ -252,8 +264,10 @@ .Ed .Pp In that case, the operator will return the storage -size of the pointer ('sizeof(char *)'), not the -allocated memory! +size of the pointer ( +.Ql sizeof(char *) +), not the +allocated memory. .Pp .Nm determines the