This question pertains to C. There have been many questions already on the topic of double underscore variables, e.g.,
What are the rules about using an underscore in a C++ identifier?
Why do people use __(double underscore) so much in C++
Meaning of double underscore in the beginning
As I understand thus far, __myvar
is reserved for use by the compiler. However, I am unsure where to find the precise meaning for such variables, and how to use them.
For example, I am studying this block of code:
#define fatalError(...) { char str[1000]; sprintf(str, __VA_ARGS__); printf( "%s (%s in %s, line %d)\n", str, __func__, __FILE__, __LINE__); exit(EXIT_FAILURE); }
For instance, it's not clear what __VA_ARGS__
refers to. Since it's reserved by the compiler, and I'm using gcc, should I be searching for __VA_ARGS__
in gcc documentation?