Show: Delphi C++
Display Preferences

#pragma warn

From RAD Studio
Jump to: navigation, search

Go Up to Pragma Directives Overview Index

Syntax (See Pseudo-grammar)

#pragma warn {+|-|.}{ XXX }


The #warn pragma lets you override specific -wXXX command-line options or compiler warnings configured in your project options. XXX is the three-letter or four-digit message identifier used by the command-line option.

The character preceding the warning identifier determines the action to be taken, as follows:

  • '+' turns on a warning.
  • '-' disables the warning.
  • '.' restores a warning to the setting defined in the Project Options dialog box.


  • The following #pragma directives are equivalent (where XXX represents the three-letter code, such as amb, that is associated with the warning message):
    • #pragma option -wXXX
    • #pragma warn -XXX
  • The following #pragma directives are equivalent (where #### represents the four-number warning message number, such as 8000):
    • #pragma option -w####
    • #pragma warn -####
  • To display all the warning message numbers and their associated -wXXX command-line options, go to the terminal window and enter the following:
> bcc32 -h -w
Also, see Message Options for a list of warning message -wXXX command-line options.

See Also

Personal tools
RAD Studio 10.2 Tokyo
In other languages
Previous Versions