This chapter lists and describes the compiler language options for the command-line tools. These options control the way the compiler parses and translates source code.
The x86 language options covered in this section include:
This section contains information about command-line options for controlling preprocessing and input file manipulation.
Specify #include searching semantics, using the following keywords.
/dis Passed to all tools (linker, etc) this option forces disassembly ofobject code.
Define symbol 'name' to 'value' if specified, else '1'
Preprocess to stdout. If only /E is specified, the file will be preprocessed to stdout. If /EP is specified, the file will be preprocessed to a file placed
in the output directory or the current working directoy (depending
on the setting of /Fo (see
/Fo+file|dir). The file extension will be .inc.
Specify extension for generated object files; with a leading period ('.'), appends extension; without, replaces source file's extension.
For extension, the maximum length is14 characters. The default is .obj
Specify stack size in kilobytes.
Send assembly listing to <source>.asm. This command puts the .asm file in the source file's directory, not in the output directory.
Prefix text file or precompiled header onto all source files.
Specify output filename or directory for object file(s) or preprocessor
output (with /P). If specifying a directory, `/Fo???' must appear before any source files.
Name precompiled header file; same as /Yc+file
Delimit groups of user paths (before /i-) from system paths (after
/i-). System paths are searched with #include <...> as well as #include "...". Default system includes (see /nodefaults and /nostdinc) are
searched after paths specified on the command line, which implies
implies /cwd explicit.
See also /CWD keyword
Add path to list of #include search paths.
Create a DLL with debugging information in it.
Add remainder of command line to linker's command line.
Give name of alternate linker. For string, the maximum length is 63 characters. The default string is mwld
Passed to linker, this selects the libraries to link with.
NOTE Libraries will be linked before all other objects -- this may not be what you want.
Continue working after errors in earlier files.
Treat #include <...> like #include "..."
Prevent header files from being processed more than once.
Specify a pragma for the compilation. This could also be done in the source code using:
Do not use standard system include paths, as specified by the
environment variable %MWCIncludes%
Generate precompiled header to file, recommended extension .mch
Check syntax only, do not compile.
This section contains information about command-line options for controlling language attributes of code compilation.
Enable C++ bool type, the true and false constants.
Enable C++ exception handling. This is the default.
The following keyword possibilities may be used:
Enable stack probing calls; size fixed at 4k, this is the default.
Enable string pooling; not exactly the same as in Visual C++ .
Use int-sized enums, this is the default.
Enable run-time typing information. This is the default.
Reuse equivalent strings. This is the default.
Enable C++ exception handling. This is the default.
Enable multi-byte character encodings for source text, comments, and strings.
Specify source language, using the following keywords:
Enable recognition of trigraphs
Check code for ARM (Annotated C++ Reference Manual) conformance.
Enable extensions: redefining macros, allowing XXX::yyy syntax when declaring method yyy of class XXX, allowing extra commas, ignoring casts to the same type, treating function types with equivalent parameter lists but different return types as equal, allowing pointer-to-integer conversions, relaxed pointer conversions, and various syntactical differences.
Allow nonstandard keywords. This is the default.
Enable wchar_t as a built-in C++ type. This is the default.
This section contains information about command-line options for controlling error and warning message generation.
Tailors warning output, using the following keywords. The default is that all warnings are turned on.
The following x86 compiler options are available.
Use basic 80x86 instruction set; default.
Generate AMD K6-3D floating-point extensions; implies /GK6
Use 3D-Now! MMX calling convention; implies /G3D
Target generic x86; define _M_IX86 to 300.
Target generic x86; define _M_IX86 to 400.
Target generic x86; define _M_IX86 to 500.
-opt off|on|all|space|speed|level=...
are for backwards compatibility; other optimization options may
be superceded by the use of -opt level=xxx.
To control optimization, you may combine options as in -O4,p
Specify structure and array alignment options:
The following x86 linker options are available.
Set loading address for image; default is 0x400000
Use command file to process exports, etc.; for file, maximum length 63 chars; default is none.
Use given linker definitions file; note: extension mustbe .DEF
Set main entry point for application or shared library; for symbol, maximum length 63 chars; default is none.
Specify export file, which must be namedfile.def.
If existing, file contains list of symbols to export (separated by newlines). If not existing, linker writes all exportablesymbols tofile.
This overrides /export none|all|pragma but complements the /export <name>[,...] option.
Specify maximum size of heap in kilobytes to reserve; default is 1024; if a parameter specified, size of heap to commit. The default is 4.
Specify maximum size of stack in kilobytes to reserve; default is 1024; if parameter specified, stack space to commit. The default is 4 .
Specify subsystem ID; default is 4,0.
Specify user ID; default is 0,0.
The following Win32 x86 linker options are available.
Emit an application binary file.
Set loading address for image; default is 0x40000000.
Use command file to process exports, etc.; for file, maximum length 63 chars; default is none.
Use given linker definitions file, note that the extension must
be .DEF.
Search library paths for library in form lib<file>.<ext> where
<ext> is .LIB or .DLL. This search path is added before system libraries (see/NODEFAULTS).
Set main entry point for application or shared library. For symbol, maximum length 63 chars; default is none.
Specify export options with these keywords:
Specify export file, which must be named<file>.def. If existing, file contains list of symbols to export (separated by newlines); if
not existing, linker writes all exportable symbols to file. This overrides the option /export none|all|pragma but complements the option /export <name>[,...].
Specify maximum size of heap in kilobytes to reserve; default is 1024; if parameter specified, size of heap to commit; default is 4.
Add library search paths. The default is to search current working
directory and then system directories (see '/X'); search paths have global scope over the command line andare
searched in the order given.
Generate link map file; default name is generated by adding .MAP to <outfile>; ifparameter specified, output to filename.
Do not use system library files or system paths; by default the
environmentvariable %MWLibraries% contains system pathsto search and the environment variable %MWLibraryFiles% contains a list of system libraries to link; both lists contain
items separated by ';'
Output SYM file information to filename (recommended extension .xSYM); default name is <outfile>.?SYM
Specify maximum size of stack in kilobytes to reserve; default is 1024; if parameter specified, stack space to commit; default is4 .
Set warning options, with possible keywords to include:
Specify subsystem using these keywords:
Specify subsystem ID; default is 4,0.
Specify user ID; default is 0,0.
The following x86 compiler debugger options are available.
Generate debugging information.
Specify debugging keyword options are:
Specify debugging keyword options are:
Generate debugging information.
Generate debugging information.
Generate debugging information.
The following x86 linker debugger options are available.
Generate debugging information.
Specify debugging keyword options are:
Specify debugging keyword options are:
The following x86 assembler debugger options are available.
Generate debugging information, same as -sym full.