Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky or suggest there is likely to be a bug in the program. Unless -Werror is specified, they do not prevent compilation of the program.
-WallTurns on all warnings messages. Warnings are not a defined part of the D language, and all constructs for which this may generate a warning message are valid code.
-WallocaThis option warns on all uses of "alloca" in the source.
-Walloca-larger-than=nWarn on unbounded uses of alloca, and on bounded uses of alloca whose bound can be larger than n bytes. -Wno-alloca-larger-than disables -Walloca-larger-than warning and is equivalent to -Walloca-larger-than=SIZE_MAX or larger.
-Wcast-resultWarn about casts that will produce a null or zero result. Currently this is only done for casting between an imaginary and non-imaginary data type, or casting between a D and C++ class.
-Wno-deprecatedDo not warn about usage of deprecated features and symbols with
deprecated attributes.
-WerrorTurns all warnings into errors.
-WspeculativeList all error messages from speculative compiles, such as
__traits(compiles, ...). This option does not report
messages as warnings, and these messages therefore never become
errors when the -Werror option is also used.
-WtemplatesWarn when a template instantiation is encountered. Some coding rules disallow templates, and this may be used to enforce that rule.
-Wunknown-pragmasWarn when a pragma() is encountered that is not understood by
gdc. This differs from -fignore-unknown-pragmas
where a pragma that is part of the D language, but not implemented by
the compiler, won’t get reported.
-Wno-varargsDo not warn upon questionable usage of the macros used to handle variable
arguments like va_start.
-fignore-unknown-pragmasTurns off errors for unsupported pragmas.
-fmax-errors=nLimits the maximum number of error messages to n, at which point
gdc bails out rather than attempting to continue processing the
source code. If n is 0 (the default), there is no limit on the
number of error messages produced.
-fsyntax-onlyCheck the code for syntax errors, but do not actually compile it. This can be used in conjunction with -fdoc or -H to generate files for each module present on the command-line, but no other output file.
-ftransition=idReport additional information about D language changes identified by id. The following values are supported:
List information on all D language transitions.
List all usages of complex or imaginary types.
List all non-mutable fields which occupy an object instance.
List all usages of in on parameter.
List all hidden GC allocations.
List statistics on template instantiations.
List all variables going into thread local storage.
List instances of Markdown replacements in Ddoc.