Warning messages

 

Type                   Switch

Syntax               {$W+} or {$W-}

{$WARN identifier ON} or

{$WARN identifier OFF}

Default               {$WARN ON}

Scope                Local

 

Remarks

The $WARN directive lets you control the display of groups of warning messages. These warnings relate to symbols or units that use the hint directives, platform, deprecated, and library (see Declarations).

The identifier in the $WARN directive is optional and can have any of the following values:

 

Identifier

Description

SYMBOL_PLATFORM

Turns on or off all warnings about the platform directive on symbols in the current unit.

SYMBOL_LIBRARY

Turns on or off all warnings about the library directive on symbols in the current unit.

SYMBOL_DEPRECATED

Turns on or off all warnings about the deprecated directive on symbols in the current unit.

UNIT_DEPRECATED

Turns on or off all warnings about the deprecated directive applied to a unit declaration.

UNIT_LIBRARY

Turns on or off all warnings about the library directive in units where the library directive is specified.

UNIT_PLATFORM

Turns on or off all warnings about the platform directive in units where the platform directive is specified.

 

The only warnings that can be turned on/off using $WARN are the ones listed above.

The warnings set by the inline $WARN directive are carried for the compilation unit in which the directive appears, after which it reverts to the previous state. The warnings set by a $WARN directive take effect from that point on in the file.

The $WARNINGS directive also controls the generation of compiler warnings (see Warnings).

 

Compiler directives (list)

Warnings