2 ms·
The article gets something wrong about C. "U0 is essentially void but with zero size. In regular C, void is actually considered a Unit Type and thus when compu
by _kst_ 3y ago
The article gets something wrong about C.
"U0 is essentially void but with zero size. In regular C, void is actually considered a Unit Type and thus when computing sizeof(void) in GCC, you will find that it resolves to 1."
In C, void has no size; the expression sizeof (void) is invalid. There are no values of type void.
gcc, as an extension, permits pointer arithmetic on pointers to void. An unfortunate side effect of this extension is that it treats sizeof (void) as 1. If you compile with "-pedantic-errors", it will reject that expression.