Why all warnings are treated as errors in the ue4 C++ project, and how to suppress all warnings?

i hate warningsaserrors, warnings are warnings, errors are errors.
i understand epic might want to do that with their own code.
but i don’t like it being forced on people.
though i’m not sure if it’s epic or the compiler the one that enable this. since the errors i get on windows and linux are different. (which makes it even more annoying).
i know it’s a compiler flag so someone had to put it.

there are times where you are fine with certain warnings. and sometimes a plugin might generate a warning.
or some warnings might be fake, or useless.
and another thing that happens on all the teams i’ve worked with, is that people stops paying attention to the warnings, since if they assume that any important warning will break the build.
all these things makes it apparent to me that “warnings as errors” is not an ideal long term strategy.
when i have a warning that are so severe that it needs to behave as an error, then it’s not a warning, it’s an error. and i mark it as such.

i want to find where to disable it.

i’ve found a few variables in Project.Target.cs
like
DefaultWarningLevel = WarningLevel.Warning;
bWarningsAsErrors = false;

i haven’t verified they work yet.

1 Like