RAD Studio (Common)
ContentsIndex
PreviousUpNext
Warning messages (Delphi)
Type  
Switch  
Syntax  
{$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.  

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

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.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!