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.
Related Contents:
- “No newline at end of file” compiler warning
- C / C++ compiler warnings: do you clean up all your code to remove them or leave them in?
- Best compiler warning level for C/C++ compilers? [closed]
- Can placement new for arrays be used in a portable way?
- Why are #ifndef and #define used in C++ header files?
- How to detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor? [duplicate]
- How do I best silence a warning about unused variables?
- How can I turn on (literally) ALL of GCC’s warnings?
- How to add a ‘or’ condition in #ifdef
- Is there a replacement for unistd.h for Windows (Visual C)?
- Can a recursive function be inline?
- how does array[100] = {0} set the entire array to 0?
- C/C++ line number
- Flags to enable thorough and verbose g++ warnings
- How to use Macro argument as string literal?
- Why is it impossible to build a compiler that can determine if a C++ function will change the value of a particular variable?
- Can #if pre-processor directives be nested in C++?
- Are the experimental features of modern C++ reliable for long-term projects?
- c++ overloaded virtual function warning by clang?
- What’s the difference between the WIN32 and _WIN32 defines in C++
- Is using #pragma warning push/pop the right way to temporarily alter warning level?
- Why use #define instead of a variable
- Portable way of setting std::thread priority in C++11
- DEBUG macros in C++
- How can I mark a C++ class method as deprecated?
- Any utility to test expand C/C++ #define macros?
- how portable is end iterator decrement?
- C++ variable has initializer but incomplete type?
- Namespaces in C
- what is “stack alignment”?
- Why is (void) 0 a no operation in C and C++?
- Which Cross Platform Preprocessor Defines? (__WIN32__ or __WIN32 or WIN32 )?
- fatal error C1010 – “stdafx.h” in Visual Studio how can this be corrected?
- Template within template: why “`>>’ should be `> >’ within a nested template argument list”
- “#ifdef” inside a macro [duplicate]
- How can I detect g++ and MinGW in C++ preprocessor?
- C/C++, can you #include a file into a string literal? [duplicate]
- How do I setup visual studio to register some #defines globally?
- For { A=a; B=b; }, will “A=a” be strictly executed before “B=b”?
- Constants and compiler optimization in C++
- C++11 Compiler: Closest to the standard and how close?
- #include directive: relative to where?
- C++ iterators & loop optimization
- What’s special about R and L in the C++ preprocessor?
- Portability of binary serialization of double/float type in C++
- How to design a C / C++ library to be usable in many client languages? [closed]
- When is the use of std::ref necessary?
- What issues can I expect compiling C code with a C++ compiler?
- What does vectorization mean?
- Can macros be overloaded by number of arguments?