5.6.3.4 Preprocessing and Messages

Table 5-7. Preprocessing and Messages Category
OptionDescriptionCommand Line
Preprocessor macrosProject-specific preprocessor macro defines passed via the compiler's –D option.

-Dmacro=defn

Include directoriesSearch these directories for project-specific include files.

-Idir

Make warnings into errorsCheck to halt compilation based on warnings as well as errors.

Uncheck to halt compilation based on errors only.

-Werror
Additional warningsCheck to enable all warnings.

Uncheck to disable warnings.

-Wall
support-ansiCheck to issue all warnings demanded by strict ANSI C.

Uncheck to issue all warnings.

-ansi
strict-ansiIssue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++.-pedantic
Use CCI syntaxEnable support for the CCI syntax.-mcci
Use IAR syntaxEnable support for syntax used by other toolchain vendors.-mext=IAR
ErrataThis option enables specific errata work-arounds identified by ID.

Valid values for ID change from time to time and may not be required for a particular variant. The ID all will enable all currently supported errata work-arounds. The ID list will display the currently supported errata identifiers along with a brief description of the errata.

-merrata=id
Enable cast alignWarn whenever a pointer is cast such that the required alignment of the target is increased. For example, warn if a char * is cast to an int * on machines where integers can only be accessed at two- or four-byte boundaries.-Wcast-align
Smart IO forwarding levelThis option attempts to statically analyze format strings passed to printf, scanf and the ‘f’ and ‘v’ variations of these functions. Uses of nonfloating point format arguments will be converted to use an integer-only variation of the library functions. Equivalent to -msmart-io=n option where n equals:
  • 0 - disables this option.
  • 1 - only convert the literal values it can prove.
  • 2 - causes the compiler to be optimistic and convert function calls with variable or unknown format arguments.
-msmart-io=n
Smart IO format stringsSpecifies what the format arguments are when the compiler is unable to determine them.-msmart-io-format=fmt
Disable ISR warnDisable warning for inappropriate use of ISR function names. By default the compiler will produce a warning if the interrupt is not attached to a recognized interrupt vector name. This option will disable that feature.-mno-isr-warn
Enable SFR warningsEnable warnings related to SFRs.-msfr-warn=on|off
Enable macro expansion in pragma config valueThis option will enable the support for macro expansion in #pragma config value. For example:
#define BAR 0x1234
#pragma config FOO=BAR
After preprocessing the file the #pragma config will become:
#pragma config FOO=0x1234 
-mexpand-pragma-config