6.1.9.18 Errorlevel Directive
The ERRORLEVEL
directive can be used to control all error, warning, and advisory messages issued by the PIC Assembler.
The directive takes a comma-separated list of arguments, where each argument has the following meaning.
Argument | Affect | Pragma equivalent |
---|---|---|
0 | Enables all advisory and warning messages | |
1 | Disables all advisory messages | |
2 | Disables all advisory and warning messages | |
-msg | Disables the indicated advisory or warning message number. If msg is a warning that was promoted to an error, it will be disabled. If msg is an error message, the assembler will issue an error. | #pragma warning disable msg |
+msg | Enables the indicated advisory or warning message number. If msg is an error message, then it is ignored. | #pragma warning enable msg |
!msg | Promotes the indicated warning message number to an error. If msg is not a warning, then the option is ignored. If msg was previously disabled, the message will remain suppressed. If a disabled msg is later re-enabled, the warning will be issued as an error, as required. | #pragma warning error msg |
push | Preserve the current state of warning messages. | #pragma warning push |
pop | Restore the state of the warning messages to that last pushed. | #pragma warning pop |
For example, ERRORLEVEL -1522
will disable any warning message numbered 1522 produced by the assembler.
Error messages cannot be disabled using this directive.