4 ms·
> Now create the docker container image. Right. If everyone downstream of you replicates your exact environment, then they won't see anything out of -Werror th
by kazinator 5y ago
> Now create the docker container image.
Right. If everyone downstream of you replicates your exact environment, then they won't see anything out of -Werror that you don't see.
Proof by Docker; QED.
For the rest of us who build programs that have to work with a wide range of compiler and compiler versions, we don't want to create work for the downstream packagers.
I don't want some downstream packaging person to be wasting their time non-productively adding "compiler shut-up patches" over top of my program because their distro is on a newer compiler, and my package drew attention to itself by suddenly failing to build. Or worse: not satisfied with shut-up patches, but they start digging into the failing code, decide that there are real problems and start fixing things, without contacting upstream.
If you take care of your warnings as a matter of habit, then your program builds quietly. When new diagnostics appear in the compiler, they stand out very boldly against your previously quiet build.
Warnings don't break the build for your downstream users; they just render it noisy. When you upgrade your compiler (perhaps due to being tipped off by thoser users), you see the noise too, and you can do something about it. You can do something about it in an official way that is committed to your trunk. The downstream people pick that up, and things are quiet again on their end also.
-Werror can be useful if you inject it into your builds externally, without committing that into the build system that ships with the program, so that other consumers of the program outside of your CI environment aren't impacted by it. It just says that, "for us, in this shop, with the version of the compiler that we have currently installed on our farm, we are treating all warnings as errors (so that changes which introduce warnings cannot pass review)."
Lone FOSS developers working by themselves (or in collaboration with others via patches) don't need that; just the habit of keeping the build clean of all warnings. The commit gatekeeping person builds everything and if they notice warnings, they can push back on the patch; no need for -Werror since a human is involved rather that simple build robot that only goes by the exit status of the build without looking at the output.