Treat ALL warnings as errors from pragma

John 76 Reputation points
2022-10-14T23:01:09.697+00:00

Hi,

I tried: #pragma warning(error)
It showed: warning C4081: expected ':'; found ')'

I tried: #pragma warning(error:)
It has no effect.

Seems it can only treat the specified warnings as errors.

Is there a way to treat all C++ compilation warnings as errors from pragma?

Thanks.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,562 questions
{count} votes