I have a piece of code which uses __COUNTER__ macro to generate unique names for variables.
__COUNTER__
Is this code portable ? I know that GCC and MSVS support it.
GCC manual, section Common Predefined Macros, states
The common predefined macros are GNU C extensions.
I've also never seen this macro in the C99, C11 or C++11 standards.
As for practical portability: Clang supports it, too.