This means that everyone else uses sizeof . It calculates the size of the expression.
In this particular case, I suspect that the check is intended to provide some property t (which should be a type name, not a variable), which I do not know from the context ... Perhaps this can be considered as a pointer (necessary for indexing the array) which excludes some types. The comment next to the macro says /* provoke compile error for invalid uses of size argument */ , which seems to support this theory.
Note that sizeof is an operator, not a function. Brackets are not needed, unless you want to directly calculate the type size, and then they are part of the expression (this is the expression for the expression). Therefore, for clarity, this can be written sizeof t == sizeof t[1] && ... or maybe (sizeof t == sizeof t[1]) .
This is a very good style to use, since it "blocks" the size calculated by the corresponding array, instead of repeating the type t . So, if the type was to change, the expression will automatically adapt and still correctly evaluate.
Many C programmers seem to for some reason prefer to have parentheses around the sizeof argument in all cases.
unwind
source share