Compiling for Debugging - Use /Ti+ to generate information for the VisualAge for C++ Debugger. Do not turn on optimization (/O+, /Oc+, /Oi+, or /Os+), for debugging information is produced as if the code were not optimized. Therefore, the information may not accurately describe an optimized program being debugged, and accurate symbol and type information may not always be available.
If you need to debug an optimized program, turn the scheduler off (/Os-), and step through the program at the assembly level using the VisualAge for C++ Debugger's Register and Storage windows for information.
Using Memory Management Functions - Use /Tm to enable the debug version of memory management functions. These functions (_debug_calloc, _debug_malloc, new, etc.) are used in place of the regular memory management functions. The compiler generates additional code at the beginning of every function that pre-initializes the local variables for the function. This makes it easier to find uninitialized local variables.
Set the Severity Level of Messages - Use /Wn to set the severity level of messages the compiler produces. The error counts are as follows: when n is 0, produce and count only severe errors; when n is 1, produce and count severe errors and errors; when n is 2, produce and count severe errors, errors and warnings; and, when n is 3, produce and count all messages (severe error, error, warning, and informational).
File Management Options - Use the following options to control the files that the compiler produces: /Fa to produce an assembler listing file that has source code as comments; /Fb to produce a Browser file for use with the VisualAge for C++ Browser; /Fc to perform a syntax check; /Fe to specify the name of the EXE or DLL file you are producing; /Fi to control the creation of precompiled header files; /Fl to produce a listing file; /Fm to produce a linker map file; /Fo to produce an object file; /Ft to control the generation of files for template resolution; and, /Fw to create intermediate code files without completing compilation.
Compiling for Analyzing - Use /Ti and /Gh options to generate information for the VisualAge for C++ Performance Analyzer.
Optimizing with the Compiler - Use /O to optimize for speed. This turns on the /Oi (turn on inlining) and /Os (invoke the instruction scheduler) options. Use /Oc to optimize for size as well as speed. Use /Ol to pass code through the intermediate linker before generating an object file. Use /Om to limit the working set size for the compiler to approximately 35M. Use /Op to perform optimizations involving the stack pointer.