Shortly, I want to know if gcc (or g++. I need it in C, but also am curious about c++) defines any special symbols if -g is enabled. Does it? I
As others have said, and as is apparent from the manual, GCC does not provide any intrinsic macros that indicate whether debug information will be generated (-g mode). What I want to add, is that this is on purpose.
Long, long ago, the original authors of GCC (RMS, Kenner, probably a couple others) decided that enabling debugging information should not cause any changes whatsoever to the actual code, to reduce the risk of a bug mysteriously vanishing when you try to debug it. This is a bedrock design principle in GCC, and even today the developers go out of their way to maintain it.
Defining a macro would violate this design principle, since it would permit the source code to change itself in response to -g.