Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
Compiler Command-Line Driver
2012-2013 Microchip Technology Inc. DS50002071C-page 87
5.7.4 Options for Controlling Warnings and Errors
Warnings are diagnostic messages that report constructions that are not inherently
erroneous but that are risky or suggest there may have been an error.
You can request many specific warnings with options beginning -W, for example,
-Wimplicit, to request warnings on implicit declarations. Each of these specific
warning options also has a negative form beginning -Wno- to turn off warnings, for
example, -Wno-implicit. This manual lists only one of the two forms, whichever is
not the default.
The following options control the amount and kinds of warnings produced by the
compiler.
-fno-builtin
-fno-builtin-function
Dont recognize built-in functions that do not begin with
__builtin_ as prefix.
-fsigned-char Let the type char be signed, like signed char.
(This is the default.)
-fsigned-bitfields
-funsigned-bitfields
-fno-signed-bitfields
-fno-unsigned-bitfields
These options control whether a bit-field is signed or
unsigned, when the declaration does not use either signed
or unsigned. By default, such a bit-field is signed, unless
-traditional is used, in which case bit-fields are always
unsigned.
-funsigned-char Let the type char be unsigned, like unsigned char.
TABLE 5-8: WARNING/ERROR OPTIONS IMPLIED BY -WALL
Option Definition
-fsyntax-only Check the code for syntax, but dont do anything beyond that.
-pedantic Issue all the warnings demanded by strict ANSI C; reject all
programs that use forbidden extensions.
-pedantic-errors Like -pedantic, except that errors are produced rather than
warnings.
-w Inhibit all warning messages.
-Wall All of the -W options listed in this table combined. This enables
all the warnings about constructions that some users consider
questionable, and that are easy to avoid (or modify to prevent
the warning), even in conjunction with macros.
-Wchar-subscripts Warn if an array subscript has type char.
-Wcomment
-Wcomments
Warn whenever a comment-start sequence /* appears in a /*
comment, or whenever a Backslash-Newline appears in a //
comment.
-Wdiv-by-zero Warn about compile-time integer division by zero. To inhibit the
warning messages, use -Wno-div-by-zero. Floating point
division by zero is not warned about, as it can be a legitimate
way of obtaining infinities and NaNs.
(This is the default.)
-Werror-implicit-
function-declaration
Give an error whenever a function is used before being
declared.
-Wformat Check calls to printf and scanf, etc., to make sure that the
arguments supplied have types appropriate to the format string
specified.
-Wimplicit Equivalent to specifying both -Wimplicit-int and
-Wimplicit-function-declaration.
TABLE 5-7: C DIALECT CONTROL OPTIONS (CONTINUED)
Option Definition
Protego_Release_01_05-Related-OEM-Documentation-MPLAB-XC16-C-Compiler.pdf