Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 90
 2012 Microchip Technology Inc.
4.6.5
Changing Message Behavior
Both the attributes of individual messages and general settings for the messaging sys-
tem can be modified during compilation. There are both driver options and C pragmas 
that can be used to achieve this.
4.6.5.1
DISABLING MESSAGES
Each warning message has a default number indicating a level of importance. This 
number is specified in the MDF and ranges from -9 to 9. The higher the number, the 
more important the warning.
Warning messages can be disabled by adjusting the warning level threshold using the 
--WARN
ings whose level is below that of the current threshold are not displayed.
The default threshold is 0 which implies that only warnings with a warning level of 0 or 
higher will be displayed by default. The information in this option is propagated to all 
compiler applications, so its effect will be observed during all stages of the compilation 
process.
Warnings may also be disabled by using the --MSGDISABLE option, see 
Section 4.8.38 “--MSGDISABLE: Disable Warning Messages”. This option takes a 
comma-separated list of message numbers. Those warnings listed are disabled and 
will never be issued, regardless of the current warning level threshold.
Some warning messages can also be disabled by using the warning pragma. This 
pragma will only affect warnings that are produced by either the parser or the code gen-
erator; i.e., errors directly associated with C code. See Section 5.14.4.11 “The 
#pragma warning Directive”
 fo
r more information on this pragma.
Error messages can also be disabled; however, a more verbose form of the command 
is required to confirm the action. To specify an error message number in the --MSG-
DISABLE
 command, the number must be followed by :off to ensure that it is disabled. 
For example: --MSGDISABLE=195:off will disable error number 195.
4.6.5.2
CHANGING MESSAGE TYPES
It is also possible to change the type of some messages. This can only be done for 
messages generated by the parser or code generator. See Section 5.14.4.11 “The 
#pragma warning Directive”
 fo
r more information on this pragma.
Note:
Disabling error or warning messages in no way fixes the condition which 
triggered the message. Always use extreme caution when exercising these 
options.