Warnings (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Compiler Directives (List) Index

Type

Switch

Syntax

{$WARNINGS ON} or {$WARNINGS OFF}

Default

{$WARNINGS ON}

Scope

Local



Remarks

The $WARNINGS directive controls the generation of compiler warnings. The $WARN directive lets control the display of groups of warning messages.

In the {$WARNINGS ON} state, the compiler issues warning messages when detecting uninitialized variables, missing function results, construction of abstract objects, and so on. In the {$WARNINGS OFF} state, the compiler generates no warning messages.

By placing code between {$WARNINGS OFF} and {$WARNINGS ON} directives, you can selectively turn off warnings that you don't care about.

Note: The $WARNINGS directive only works at the procedure or function level granularity. That is, you can surround entire procedures and functions with the $WARNINGS directive, but not blocks of statements within a procedure or function.

See Also