6 ms·
I'm disappointed that the answer does not have any discussion about the problems with mixing `-Weverything` and `-Werror`. In case you're not aware, the issue
by lilyball 7y ago
I'm disappointed that the answer does not have any discussion about the problems with mixing `-Weverything` and `-Werror`.
In case you're not aware, the issue with this is upgrading your compiler almost certainly causes your project to stop compiling altogether, requiring immediate fixes to stuff that otherwise could have waited. What's worse, it also means you can't go back and compile older versions of your code with the newer compiler.
- antpls 7y agoIf you want your code to compile with the next versions of the compiler, you wouldn't wait the latest official stable release of the compiler to start looking at your future work. You would have a step in your CI that periodically checks out the latest compiler's revision/nightly and build your codebase with it. It wil surely fail, but you know what is coming months in advance before the stable release is out
- ikiris 7y agoAt that point just flag the warnings instead of having it break the build...
- Leherenn 7y agoThis certainly changes for open-source vs closed-source code, but for the latter it's not much of a problem. Either you use docker to have a stable environment, or you disable the Werror warning for this specific case.
- lilyball 7y agoThere are more closed-source projects than fit in the Docker workflow.
- edflsafoiewq 7y agoThat won't necessarily be enough to save you either because the existing warnings can still change. Here's some Rust code use foo; fn my_function() { use foo; foo::other_function() } This used to not trigger a warning. In rustc 1.35, the existing warning unused_imports became smarter and could now detect the redundant import of foo. This resulted in several crates that had made unused item warnings into errors having the exact problem you said. I think -Werror is a bad idea in general.
- NohatCoder 7y agoIndeed, I still don't see the point, the only non-superfluous thing -Werror does is to break builds for random people at random points in time.