How can you create a compiler warning (in the model of #error, except as a warning) on purpose in Visual C++ that will show up on the Error List with the correct file and line number?
GCC and other compilers offer #warning, but the MSVC compiler does not.
The “solution” at http://support.microsoft.com/kb/155196 does not parse in the Visual Studio error list.
Just add this to your common include file (ex, stdafx.h):
Use this like:
The compiler will output:
And the Error List tab will show the warning nicely in the table:
exactly like a normal Visual Studio compiler warning.