4 ms·
From the article: “some (many?) folks in the open source and academic world hate -Werror with passion” (emphasis mine). In the open source world, the developer
by strenholme 5y ago
From the article: “some (many?) folks in the open source and academic world hate -Werror with passion” (emphasis mine).
In the open source world, the developer can not control which compiler their users will use to try and compile their program. (OK, the article advocates forcing users to use Docker, but that significantly restricts who will be able to use their software.)
This leads to a lot of interesting coding style practices. For a while, I needed to always declare variables at the beginning of my functions because FreeBSD users at the time would make a stink because their compiler back then could not handle variables declared mid-function.
-Werror was unthinkable. More like, -Wall and people would make a stink on the mailing list when they saw compiler warnings. Of course, I would minimize them, but new compiler warnings come up with every GCC update (CLANG makes a lot fewer warnings), and I can just imagine what my GitHub issues page would look like if I were foolish enough to actually use -Werror
The linked article is wrong. Do not, repeat, do not use -Werror in environments where end users will compile the code themselves. Feel free, however, to use -Werror for CI builds on a Docker container with a known version of GCC.