How is it that "sizeof (char[0])" compiles just fine with GCC

A colleague of mine inserted a (void) sizeof (char[0]) at the end of a multi line, macro as an alternative to do {...} while (0) apparently. I have looked around but I can’t find any reference to it and it surprises me that it even compiles.

Is it valid C? I would love a reference to the std.


Source: gcc

Leave a Reply