News for hackers. Stuff that matters.
Re:I got the J language working on OpenBSD by unwind on Sunday September 12, 2021 @04:20PM (#28504519)
I know nothing about OpenBSD, but one reason to avoid -Werror in shipping code that I've heard is that the set of warnings is a moving target.

It's easy to imagine having a compiler upgrade then add new warnings, that cause unchanged code in a project with -Werror to no longer build, thus breaking it.

Of course it can be argued that such "exposure" flushes out bad code with a vengeance, but it can also be considered to be annoying.

Re:I got the J language working on OpenBSD by userbinator on Sunday September 12, 2021 @05:04PM (#28504917)
The new warnings also tend to be increasingly asinine, and I remember an instance where two warnings happened to be in direct contradiction to each other, making it impossible to satisfy them both without some extensive and absolutely useless rewriting of the code.

I think one was about superfluous parentheses, and the other about not parenthesising an expression because it assumed the programmer would be too stupid to know the precedence of operators.

Re:I got the J language working on OpenBSD by arthurcolle on Sunday September 12, 2021 @07:52PM (#28506293)
Rubocop is so bad about this. I can't believe people still use it. I spent 2 hours refactoring perfectly legal code to satisfy a code review and then found the suppress warnings invocation and ended up shipping that.
Re:I got the J language working on OpenBSD by mikepurvis on Sunday September 12, 2021 @05:27PM (#28505149)
As someone in a DevOps role who has three times been the steward of major migrations between baseline OS versions, I have often been frustrated at teams who have hard-coded -Werror into their build configs, thus forcing me to jump through hoops to patching it out because the new compiler has some trivial complaint about this or that and the build is uncompileable on the new target.

I understand the noble goal of being warning-clean, but I wish there was a way to implement it in such a way that it could also be globally disabled. Then I could get a top level build, but the local resolution of the issues would still be on the owners of the code.

Re:I got the J language working on OpenBSD by initplus on Sunday September 12, 2021 @05:36PM (#28505225)
Zero warnings is the kind of thing that should be enforced as a pre merge check rather than a build showstopper.
Re:I got the J language working on OpenBSD by cowsandmilk on Monday September 13, 2021 @05:56AM (#28509482)
In the case of the team moving to a new compiler, what are you suggesting? We can’t merge in use of a newer compiler until there are zero warnings in all our products? Who “fixes” all those code bases? Who touches the pieces of code that were last touched 5 or 10 years ago?
Re:I got the J language working on OpenBSD by mikepurvis on Monday September 13, 2021 @10:57AM (#28512288)
Various solutions are possible, including the obvious one of just removing -Werror. But the point is that this decision should be made by the team that owns/maintains the code, not by some centralized devops group.
Re:I got the J language working on OpenBSD by mikepurvis on Sunday September 12, 2021 @09:35PM (#28506932)
Yeah, 100% agree. Or even better, for incremental improvement, have it enforce no new warnings.

But all of this requires adding complexity and branching to the system. It can be done and is worth doing, you just have to choose your battles.

Re:I got the J language working on OpenBSD by axiolite on Monday September 13, 2021 @12:01AM (#28507746)
> It's easy to imagine having a compiler upgrade [...]

Not in OpenBSD it isn't.

Re:I got the J language working on OpenBSD by gbrown_ on Tuesday September 21, 2021 @04:03PM (#28609268)
Since the move to Clang/LLVM the compiler in OpenBSD has been pretty up to date.