07.04.2013 Views

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16-Bit C <strong>Compiler</strong> User’s Guide<br />

TABLE 3-6: WARNING/ERROR OPTIONS NOT IMPLIED BY -WALL<br />

-Wconversion Warn if a prototype causes a type conversion that is different<br />

from what would happen to the same argument in the<br />

absence of a prototype. This includes conversions of fixed<br />

point to floating <strong>and</strong> vice versa, <strong>and</strong> conversions changing the<br />

width or signedness of a fixed point argument, except when<br />

the same as the default promotion.<br />

Also, warn if a negative integer constant expression is<br />

implicitly converted to an unsigned type. For example, warn<br />

about the assignment x = -1 if x is unsigned. But do not<br />

warn about explicit casts like (unsigned) -1.<br />

-Werror Make all warnings into errors.<br />

-Winline Warn if a function can not be inlined, <strong>and</strong> either it was<br />

declared as inline, or else the -finline-functions option<br />

was given.<br />

-Wlarger-than-len Warn whenever an object of larger than len bytes is defined.<br />

-Wlong-long<br />

-Wno-long-long<br />

Warn if long long type is used. This is default. To inhibit the<br />

warning messages, use -Wno-long-long. Flags<br />

-Wlong-long <strong>and</strong> -Wno-long-long are taken into account<br />

only when -pedantic flag is used.<br />

-Wmissing-declarations Warn if a global function is defined without a previous<br />

declaration. Do so even if the definition itself provides a<br />

prototype.<br />

-Wmissing<strong>for</strong>mat-attribute<br />

If -W<strong>for</strong>mat is enabled, also warn about functions that might<br />

be c<strong>and</strong>idates <strong>for</strong> <strong>for</strong>mat attributes. Note these are only possible<br />

c<strong>and</strong>idates, not absolute ones. This option has no effect<br />

unless -W<strong>for</strong>mat is enabled.<br />

-Wmissing-noreturn Warn about functions that might be c<strong>and</strong>idates <strong>for</strong> attribute<br />

noreturn. These are only possible c<strong>and</strong>idates, not absolute<br />

ones. Care should be taken to manually verify functions.<br />

Actually, do not ever return be<strong>for</strong>e adding the noreturn<br />

attribute; otherwise subtle code generation bugs could be<br />

introduced.<br />

-Wmissing-prototypes Warn if a global function is defined without a previous<br />

prototype declaration. This warning is issued even if the<br />

definition itself provides a prototype. (This option can be used<br />

to detect global functions that are not declared in header files.)<br />

-Wnested-externs Warn if an extern declaration is encountered within a<br />

function.<br />

-Wno-deprecateddeclarations<br />

Option Definition<br />

Do not warn about uses of functions, variables <strong>and</strong> types<br />

marked as deprecated by using the deprecated attribute.<br />

-Wpadded Warn if padding is included in a structure, either to align an<br />

element of the structure or to align the whole structure.<br />

-Wpointer-arith Warn about anything that depends on the size of a function<br />

type or of void. The compiler assigns these types a size of 1,<br />

<strong>for</strong> convenience in calculations with void * pointers <strong>and</strong><br />

pointers to functions.<br />

-Wredundant-decls Warn if anything is declared more than once in the same<br />

scope, even in cases where multiple declaration is valid <strong>and</strong><br />

changes nothing.<br />

-Wshadow Warn whenever a local variable shadows another local<br />

variable.<br />

DS51284H-page 44 © 2008 <strong>Microchip</strong> Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!