GDC(1)

NAME
gdc - A GCC-based compiler for the D language

SYNOPSIS
gdc [-c]
    [-g] [-pg] [-Olevel]
    [-Idir...] [-Ldir...]
    [-o outfile] infile...

For any given input file, the file name suffix determines what kind of compilation is done:

file.d
    D source files.

file.di
    D interface files.

file.o
    Object files to link in.

file.a
    Library files to link in

DESCRIPTION
The gdc command is a frontend to gcc and supports many of the same options. This manual only documents the options specific to gdc. Most of these have both positive and negative forms; the negative form of -ffoo would be -fno-foo. This manual documents only one of these two forms, whichever one is not the default.

The gdc command may be used to compile D source code into an object file, link a collection of object files together, or do both in sequence.

Only the most useful options are listed here; see below for the remainder.

OPTIONS

-frelease
    Compile release version.

-funittest
    Compile in unittest code.

-fno-assert
    Turn off code generation for runtime assert()'s.

-fno-invariants
    Turn off code generation for runtime invariant()'s.

-fno-in
    Turn off code generation for runtime in() contracts.

-fno-out
    Turn off code generation for runtime out() contracts.

-fno-bounds-check
    Turns off array bounds checking for all functions.

-fno-builtin
    Don't recognize built-in functions that do not begin with __builtin_ as prefix.

-fd-verbose
    Print information about D language processing to stdout.

-fproperty
    For D2, enforce @property syntax.

-fd-vtls
    List all variables going into thread local storage.

-fignore-unknown-pragmas
    Ignore unsupported pragmas.

-fsplit-dynamic-arrays
    Split dynamic arrays into length and pointer when passing to functions.

-femit-templates
    Control template emission behaviour.

    Turning on this option will emit all templates, but make them private to the translation unit. The executable will have multiple copies of code and data.

    Turning off this option will tell the compiler to not emit templates at all.

    The default behaviour is to emit templates, but only if the compiler determines that it needs to.

-fdebug=opt
    Compile in debug code into the program.

    These are supported options:

    level
        Compile in debug code <= level.

    ident
        Compile in debug code identified by ident.

-fdeps=filename
    Write module dependencies to filename.

-fmake-deps=filename
    Write makefile dependency output to the given file.

-fmake-mdeps=filename
    Like -fmake-deps=filename but ignore system header files.

-fonly=filename
    Process all modules specified on the command line, but only generate code for the module specified by the argument.

-fversion=opt
    Compile in version code into the program.

    These are the supported options:

    level
        Compile in version code >= level.

    ident
        Compile in debug code identified by ident.

-fintfc
    Generate D interface files.

-fintfc-dir=directory
    Write D interface files to directory.

-fintfc-file=filename
    Write D interface file to filename.

-fdoc
    Generate documentation.

-fdoc-dir=directory
    Write documentation file in directory.

-fdoc-file=filename
    Write documentation file to filename.

-fdoc-inc=filename
    Include a Ddoc macro file.

-fXf=filename
    Write JSON file to filename.

-fdump-source
    Dump decoded UTF-8 text from source.

-Wcast-result
    Warn about casts that will produce a null or nil result.

-Werror
    Make all warnings into errors.

-Wno-deprecated
    Do not warn about usage of deprecated features.

-Wunknown-pragmas
    Warn when a pragma is encountered that is not understood by GDC.

SEE ALSO
gpl(7), gfdl(7), fsf-funding(7), gcc(1) and the Info entries for gdc and gcc.

COPYRIGHT
Copyright (c) 2011, 2012 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, the Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page gfdl(7).

(a) The FSF's Front-Cover Text is:

     A GNU Manual

(b) The FSF's Back-Cover Text is:

     You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development.