DMD(1) The D Language Foundation DMD(1)

dmd - Digital Mars D2.x Compiler

dmd files ... [ -switch ... ]

dmd Compiles source code written in the D programming language.

D source files to compile
D interface files
Object files to link in
Library files to link in
A file to read more command-line arguments from, which may contain # single-line comments
Generate code for all template instantiations
Omit generating some runtime information and helper functions
Bounds checks on, in @safe only, or off
Compile only, do not link
Enable or disable specific checks
List information on all available checks
Behavior on assert/boundscheck/finalswitch failure
List information on all available check actions
Turn colored console output on
Force colored console output on or off, or only when not redirected (default)
Use config file at filename
Do code coverage analysis
Include code executed during CTFE in coverage report
Require at least nnn% code coverage
Generate documentation
Write documentation file to directory
Write documentation file to filename
Silently allow deprecated features and symbols
Issue an error when deprecated features or symbols are used (halt compilation)
Issue a message when deprecated features or symbols are used (default)
Compile in debug code
Compile in debug code <= level
Compile in debug code identified by ident
Set symbolic debug library to name
Set default library to name
Print module dependencies (imports/file/version/debug/lib)
Write module dependencies to filename (only imports)
Set C++ name mangling compatibility with standard
List all supported standards
Generate position independent code
Generate position independent executables
Add symbolic debug info
Add DWARF symbolic debug info
Emit debug info for all referenced types
Always emit stack frame
Add stack stomp code
Generate 'header' file
Write 'header' file to directory
Write 'header' file to filename
Generate C++ 'header' file
List available modes for C++ 'header' file generation
Write C++ 'header' file to directory
Write C++ 'header' file to filename
Print help and exit
Look for imports also in directory
Include imported modules in the compilation
Ignore unsupported pragmas
Do function inlining
Look for string imports also in directory
Pass linkerflag to link
Generate library rather than object files
Enable garbage collection for the compiler
Generate 32 bit code
Generate 64 bit code
Add default main() (e.g. for unittesting)
Print dependencies in Makefile compatible format to filename or stdout.
Open web browser on manual page
Generate linker .map file
Generate instructions for architecture identified by id
List all architecture options
Expand and save mixins to file specified by filename
Use <filespec> as source file for package.module
No array bounds checking (deprecated, use -boundscheck=off)
Do not write object file
Write object & library files to directory
Name output file to filename
Preserve source path for output files
Enable an upcoming language change identified by name
List all upcoming language changes
Profile runtime performance of generated code
Profile runtime allocations
Compile release version
Revert language change identified by name
List all revertable language changes
Compile, link, and run the program srcfile
Generate shared library (DLL)
Use triple as <arch>-[<vendor>-]<os>[-<cenv>[-<cppenv]]
Help with language change identified by name
List all language changes
Compile in unit tests
Print character (column) numbers in diagnostics
Set the style for file/line number annotations on compiler messages
Limit the number of error messages (0 means unlimited)
Show error messages with the context of the erroring source line
Show errors from speculative compiles such as __traits(compiles,...)
Print compiler version and exit
Compile in version code >= level
Compile in version code identified by ident
List all gc allocations including hidden ones
List all variables going into thread local storage
List statistics on template instantiations
Warnings as errors (compilation will halt)
Warnings as messages (compilation will continue)
Generate JSON file
Write JSON file to filename
Pass driverflag to linker driver (cc)

Language changes listed by -transition=id:

List all non-mutable fields which occupy an object instance
List all variables going into thread local storage
List instances of Markdown replacements in Ddoc

Linking is done directly by the dmd compiler after a successful compile. To prevent dmd from running the linker, use the -c switch.

The actual linking is done by running gcc. This ensures compatibility with modules compiled with gcc.

/etc/dmd.conf dmd will look for the initialization file dmd.conf in the directory /etc. If found, environment variable settings in the file will override any existing settings.

The D compiler dmd uses the following environment variables:

The value of DFLAGS is treated as if it were appended on the command line to dmd.

Copyright (c) 1999-2021 by The D Language Foundation written by Walter Bright

dmd.conf(5) rdmd(1) dumpobj(1) obj2asm(1) gcc(1)

2021-10-15 The D Language Foundation