Export (0) Print
Expand All

The #warning Conditional Directive

Visual Studio 6.0

The #warning directive takes a string as an argument and produces a warning message at compile-time. Warnings produced by this directive are displayed as normal compiler warnings.

Like the #error directive, this directive is most useful for detecting pre-defined constraints and inconsistencies during preprocessing of a source file.


#warning <message string>

The message string identifier shown above indicates the warning message to be displayed. The following example illustrates use of the #warning directive:

    #if !TRACING
        #warning This interface has not been completely tested yet!

When the warning above is encountered, the following line will be output:

    #warning 'This interface has not been completely tested yet!' (J5500)
© 2014 Microsoft