After writing the answer to this question , which displays the solution during compilation with an error, I wondered if it is possible to get a warning instead and complete the compilation (as it is actually indicated in the question).
Although the diagnostics generally depend on the compiler, for some code it is pretty obvious that an error will be caused (for example, access to a nonexistent element or an attempt to create an instance of an object of an incomplete type).
The same cannot be said for warnings, as they tend to be very different between compilers. Although it is reasonable to assume that alerts triggered by GCC will also be triggered by Clang, the same cannot be said for Visual C ++.
Question:
What warnings, if any, will be run sequentially on all three of the mentioned compilers?
/W3on VC ++ and -Wallon GCC and Clang we can assume.
Please note that this is not only useful for this issue, but may also be useful for triggering alerts for custom messages.
source
share