RE: Debug define name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Paulo,

> Thanks Eljay for the quick answer.  Your answer help me a lot, specially about the TRACE trick.

You are most welcome.  :-)

> About the "reserved symbols", I tried to discover it and didn't found anywhere. Is there any command or gcc parameter to know the reserved symbols? The only way that I got is to create a program to print all known defines.

ALL symbols that begin with a single underscore and a capital letter are reserved, as per the C++ language specification (ISO 14882).

ALL symbols that have two underscores ANYWHERE in there name are reserved, as per the C++ language specification (ISO 14882).

Using the magic of GCC's preprocessor, you can get a listing of all #define's in your translation unit (compilation):

For example, to see all the compiler pre-#define's:

touch Empty.cpp
g++ -E -dM Empty.cpp | sort

For example:

echo "#include <iostream>" > JustIostream.cpp
g++ -E -dM JustIostream.cpp | sort

Along those same diagnostic lines, here's a trick to see the optimization flags:

touch Empty.cpp
g++ -O2 -fverbose-asm -S Empty.cpp -o -

Note that not all optimizations have twiddle-able -f switches.

Also note that if optimizations are disabled (-O0), then none of the -f switches have any bearing.  The one's that are displayed for -O0 using this trick are fallow.

Sincerely,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux