Compiler Options Listed by Category
The following is a comprehensive categorical list of compiler options. For an alphabetical list, see Compiler Options Listed Alphabetically.
Optimization
Option |
Purpose |
---|---|
Creates small code |
|
Creates fast code |
|
Controls inline expansion |
|
Disables optimization |
|
Uses global optimizations |
|
Generates intrinsic functions |
|
Favors small code |
|
Favors fast code |
|
Uses maximum optimization (/Ob2gity /Gs) |
|
Omits frame pointer (x86 only) |
Code Generation
Option |
Purpose |
---|---|
Use SSE or SSE2 instructions in code generation (x86 only) |
|
Increases the number of addressable sections in an .obj file. |
|
Produces an output file to run on the common language runtime |
|
Specifies the model of exception handling |
|
Produces code that is optimized for a specific x64 architecture or for the specifics of micro-architectures in both the AMD64 and Extended Memory 64 Technology (EM64T) architectures. |
|
Specify floating-point behavior. |
|
Optimize for Itanium processor. Only available in the IPF cross compiler or IPF native compiler. |
|
Optimize for Itanium2 processor. Only available in the IPF cross compiler or IPF native compiler. |
|
Uses the __cdecl calling convention (x86 only) |
|
Activates stack probes |
|
Enables string pooling |
|
Calls hook function _penter |
|
Calls hook function _pexit |
|
Enables whole program optimization |
|
Enables minimal rebuild |
|
Enables run-time type information (RTTI) |
|
Uses the __fastcall calling convention (x86 only) |
|
Controls stack probes |
|
Supports fiber safety for data allocated using static thread-local storage |
|
Enables synchronous exception handling |
|
Enables function-level linking |
|
Uses the __stdcall calling convention (x86 only) |
|
Creates a multithreaded DLL using MSVCRT.lib |
|
Creates a debug multithreaded DLL using MSVCRTD.lib |
|
Creates a multithreaded executable file using LIBCMT.lib |
|
Creates a debug multithreaded executable file using LIBCMTD.lib |
|
Generates fast transcendentals. |
|
Removes fwait commands inside try blocks. |
Output Files
Option |
Purpose |
---|---|
Creates a listing file Sets listing file name |
|
Creates a listing file Sets listing file name |
|
Renames program database file |
|
Renames the executable file |
|
Creates a mapfile |
|
Creates an object file |
|
Specifies a precompiled header file name |
|
Generates browser files |
|
Merges injected code with source file |
Debugging
Option |
Purpose |
---|---|
Buffers security check |
|
Same as /RTC1 |
|
Forces parameters passed in registers to be written to their locations on the stack upon function entry. This compiler option is only for the x64 compilers (native and cross compile). |
|
Enables run-time error checking |
|
Detects 64-bit portability problems |
|
Places complete debugging information in all object files |
|
Injects a PCH reference when creating a debug library |
|
Generates C 7.0–compatible debugging information |
|
Generates complete debugging information |
|
Includes debug information in a program database compatible with Edit and Continue (x86 only) |
|
Generates debuggable optimized code. Only available in the IPF cross compiler or IPF native compiler. |
Preprocessor
Option |
Purpose |
---|---|
Specifies a directory to search to resolve file references passed to the #using directive |
|
Preserves comments during preprocessing |
|
Defines constants and macros |
|
Copies preprocessor output to standard output |
|
Copies preprocessor output to standard output |
|
Preprocesses the specified include file |
|
Forces the use of a file name, as if it had been passed to the #using directive |
|
Searches a directory for include files |
|
Writes preprocessor output to a file |
|
Removes a predefined macro |
|
Removes all predefined macros |
|
Ignores the standard include directory |
Language
Option |
Purpose |
---|---|
Enables #pragma omp in source code. |
|
Suppresses or enables hidden vtordisp class members |
|
Uses best base for pointers to members |
|
Uses full generality for pointers to members |
|
Declares multiple inheritance |
|
Declares single inheritance |
|
Declares virtual inheritance |
|
Disables language extensions |
|
Specifies standard behavior under /Ze |
|
Enables language extensions |
|
Generates function prototypes |
|
Removes default library name from .obj file |
|
/Zpn |
Packs structure members |
Checks syntax only |
Linking
Option |
Purpose |
---|---|
Sets stack size |
|
Creates a dynamic-link library |
|
Creates a debug dynamic-link library |
|
Create an MSIL module. |
|
Passes the specified option to LINK |
|
Compiles to create a multithreaded DLL, using MSVCRT.lib |
|
Compiles to create a debug multithreaded DLL, using MSVCRTD.lib |
|
Compiles to create a multithreaded executable file, using LIBCMT.lib |
|
Compiles to create a debug multithreaded executable file, using LIBCMTD.lib |
Precompiled Header
Option |
Purpose |
---|---|
Ignores all other precompiled-header compiler options in the current build |
|
Creates a precompiled header file |
|
Places complete debugging information in all object files |
|
Uses a precompiled header file during build |
Miscellaneous
Option |
Purpose |
---|---|
Lists the compiler options |
|
Specifies a response file |
|
Enables code analysis. |
|
Compiles without linking |
|
Process documentation comments to an XML file. |
|
Allows you to provide internal compiler error (ICE) information directly to the Visual C++ team. |
|
Display full path of source code files passed to cl.exe in diagnostic text. |
|
Restricts the length of external (public) names |
|
Lists the compiler options |
|
Creates a hotpatchable image. |
|
Changes the default char type |
|
Builds multiple source files concurrently. |
|
Suppresses display of sign-on banner |
|
Suppresses the call of the helper function _ftol when a conversion from a floating-point type to an integral type is required (x86 only) |
|
Does not generate sequences of instructions that give unexpected results, according to the errata for the B CPU stepping. (IPF only) |
|
Does not generate sequences of instructions that give unexpected results, according to the errata for the C CPU stepping. (IPF only) |
|
Do not use upper 96 floating-point registers. (IPF only) |
|
Generates an image with position dependent code (IPF only). |
|
Enhance performance for programs that do not create functions at runtime. (IPF only) |
|
Displays a list of all include files during compilation |
|
Specifies a C source file |
|
Specifies a C++ source file |
|
Sets the version string |
|
Enables all warnings, including warnings that are disabled by default |
|
Sets warning level |
|
Disables all warnings |
|
Enables one-line diagnostics for error and warning messages when compiling C++ source code from the command line |
|
Specifies the precompiled header memory allocation limit |