I have a macro that uses GCC\'s typeof to create a variable of the same type of a macro argument. The problem is: if that argument has const type, the variable crea
const
Is it possible to un-const typeof in gcc pure C?
I don't thing so, but this will work:
#define DECR(x) __extension__({__typeof__(x) y = x - 1; y;})
Note that __extension__ is used for disable ISO C forbids braced-groups within expressions[-pedantic] warning.
__extension__
ISO C forbids braced-groups within expressions[-pedantic]