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 93
5.7.5 Options for Debugging
The following options are used for debugging.
-Wsign-compare
-Wno-sign-compare
Warn when a comparison between signed and unsigned
values could produce an incorrect result when the signed
value is converted to unsigned. This warning is also enabled
by -W; to get the other warnings of -W without this warning,
use -W -Wno-sign-compare.
-Wstrict-prototypes Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted
without a warning if preceded by a declaration which specifies
the argument types.)
-Wtraditional Warn about certain constructs that behave differently in
traditional and ANSI C.
Macro arguments occurring within string constants in the
macro body. These would substitute the argument in
traditional C, but are part of the constant in ANSI C.
A function declared external in one block and then used
after the end of the block.
A switch statement has an operand of type long.
A nonstatic function declaration follows a static one. This
construct is not accepted by some traditional C compilers.
-Wundef Warn if an undefined identifier is evaluated in an #if
directive.
-Wwrite-strings Give string constants the type const char[length] so that
copying the address of one into a non-const char * pointer
will get a warning. These warnings will help you find at
compile time code that you can try to write into a string
constant, but only if you have been very careful about using
const in declarations and prototypes. Otherwise, it will just be
a nuisance, which is why -Wall does not request these
warnings.
TABLE 5-10: DEBUGGING OPTIONS
Option Definition
-g Produce debugging information.
The compiler supports the use of -g with -O making it possible to debug opti-
mized code. The shortcuts taken by optimized code may occasionally pro-
duce surprising results:
Some declared variables may not exist at all;
Flow of control may briefly move unexpectedly;
Some statements may not be executed because they compute constant
results or their values were already at hand;
Some statements may execute in different places because they were
moved out of loops.
Nevertheless it proves possible to debug optimized output. This makes it
reasonable to use the optimizer for programs that might have bugs.
-Q Makes the compiler print out each function name as it is compiled, and print
some statistics about each pass when it finishes.
TABLE 5-9: WARNING/ERROR OPTIONS NOT IMPLIED BY -WALL
Option Definition

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh