Portability of #warning preprocessor directive

It should be noted that MSVC uses the syntax:

#pragma message ( "your warning text here" )

The usual #warning syntax generates a fatal error

C1021: invalid preprocessor command 'warning'

so it is not portable to those compilers.

Leave a Comment