C/C++ compiler options on workstation UNIX platforms

Compile your C/C++ programs with the -g option (to generate debugging information) if you want to be able to debug your program at the source code statement level. You should also consider using the following options:

Option Purpose
-qnoopt Compiles your program with optimization off. This is the default. (Some optimizations reorder the execution sequence of your program, while others may eliminate expressions whose result is never used. You may find it confusing to debug a program compiled with optimization, because statements may execute in a nonsequential fashion or not at all.)
-Q! Compiles your program with inlining off. This is the default.

Note: If you use the -bstabcmpct linker option when compiling programs that use DirectToSom or C++ namespaces, you should only specify a value of 1 (the default) or 0 (for example, -bstabcmpct:0) for versions of the program you intend to debug. If you specify -bstabcmpct:2 you will not be able to debug such programs.