Keil Logo

WARNING Compiler Directive

Abbreviation

WA

Arguments

A level and a numeric list of warning messages.

Default

None.

µVision

Options — C251 — Misc Controls.

Description

The WARNING directive changes the level of individual compiler warnings. You may disable a selected warning, list it only once, or treat the warning message as an error. The WARNING directive also allows you to change the warning level in which the message is listed. Refer to Error Messages for a complete list of compiler warnings.

The WARNING directive has the following format:

WARNING level = warning 〚, warning

where

level is the level to which the warning is switched or a command that determines subsequent compiler action for the warning(s).
warning is the number of the warning message to modify.

Following are valid values for level:

Level Description
0 Changes the warning level to 0.
1 Changes the warning level to 1.
2 Changes the warning level to 2.
3 Changes the warning level to 3.
disable Disables the warning.
error Converts the warning to an error.
once Lists only the first occurrence of the warning.

 

  • Warnings in the range 300-399 are originated in the preprocessor and cannot be disabled.
See Also

WARNINGLEVEL

Example
#pragma warning error = 95
   /* changes warning 95 to an error */

#pragma warning once = 56, 57
   /* report only the first occurrence */
   /* of warning 56 & 57 */
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.