3 ms·
At the risk of stating obvious - typeof is a gcc-ism, not a part of the C standard.
by huhtenberg 12y ago
At the risk of stating obvious - typeof is a gcc-ism, not a part of the C standard.
- unwind 12y agoThanks, that saved me some keystrokes. Here's the GCC manual page: https://gcc.gnu.org/onlinedocs/gcc/Typeof.html https://gcc.gnu.org/onlinedocs/gcc/Typeof.html, note that you can go "Up" to the main Extensions section where you'll find the sub-page for typeof. Also, the OP does the usual "everything is a function in C" error, which is weird in a text about macros in programming languages. The typeof extension, like sizeof, is not a function, it's a unary prefix operator. But nobody seems to care about that for (the standard) sizeof operator, so I guess I shouldn't be surprised. Also, of course the local temporary variable should be marked as const.