Compiler Options Listed by Category
This article contains a 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. |
|
Specifies floating-point behavior. |
|
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 by using static thread-local storage. |
|
Enables synchronous exception handling. |
|
Enables function-level linking. |
|
Uses the __stdcall calling convention. (x86 only) |
|
Creates a multithreaded DLL by using MSVCRT.lib. |
|
Creates a debug multithreaded DLL by using MSVCRTD.lib. |
|
Creates a multithreaded executable file by using LIBCMT.lib. |
|
Creates a debug multithreaded executable file by using LIBCMTD.lib. |
|
Generates fast transcendentals. |
|
Removes fwait commands inside try blocks. |
|
Enables automatic parallelization of loops that are marked with the #pragma loop() directive. |
|
Enables reporting levels for automatic vectorization. |
|
Produces an output file to run on the Windows Runtime. |
Output Files
Option |
Purpose |
---|---|
Configures an assembly listing file. |
|
Creates an assembly listing file. |
|
Renames program database file. |
|
Renames the executable file. |
|
Specifies the preprocessed output file name. |
|
Creates a mapfile. |
|
Creates an object file. |
|
Specifies a precompiled header file name. |
|
Generates browser files. |
|
Merges injected code with the source file. |
Debugging
Option |
Purpose |
---|---|
Checks buffer security. |
|
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) |
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. |
|
Selects how the volatile keyword is interpreted. |
|
Disables language extensions. |
|
Specifies standard behavior under /Ze. |
|
Enables language extensions. |
|
Generates function prototypes. |
|
Removes the default library name from the .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. |
|
Creates an MSIL module. |
|
Passes the specified option to LINK. |
|
Compiles to create a multithreaded DLL, by using MSVCRT.lib. |
|
Compiles to create a debug multithreaded DLL, by using MSVCRTD.lib. |
|
Compiles to create a multithreaded executable file, by using LIBCMT.lib. |
|
Compiles to create a debug multithreaded executable file, by 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. |
|
Processes documentation comments to an XML file. |
|
Enables you to provide internal compiler error (ICE) information directly to the Visual C++ team. |
|
Displays the 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. |
|
The compiler and linker will create a binary that can be executed in the Windows kernel. |
|
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). |
|
Enhances performance for programs that do not create functions at runtime. (IPF only) |
|
Enables additional security features and warnings. |
|
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. |