News for hackers. Stuff that matters.
Re:Finding More Than One Worm in the Apple by sanxiyn on Thursday May 15, 2014 @03:45AM (#7748254)
One interesting point is that "goto fail" in this case causes dead code. Shouldn't compilers warn about dead code?

There is -Wunreachable-code. GCC used to have it, but removed it. Clang has it, but does not enable it (you specifically need to request it). Apparentlly it causes too much noises to enable by default.

Re:Finding More Than One Worm in the Apple by josteink on Thursday May 15, 2014 @08:01AM (#7748913)
The C# compiler has this sort of warning on by default.

Unfortunately, it warns about lots of things which the "lazier" developers really can't be arsed to do (like documenting the public methods and classes in their APIs).

The result is that in a team where not everyone is vigilant, a bigger project is doomed to have a compiler output with 100s and 100s warnings about things left and right.

And the result is that almost everyone ignores the compiler warnings, even when it tells you about things which are legitimate errors.

In short: The noise is a feature but is treated like a bug. The result of that is buggy code. I'm not sure how or if such a thing can be fixed by technology alone. A major shift in culture is probably also needed.

Re:Finding More Than One Worm in the Apple by duncans on Thursday May 15, 2014 @08:14AM (#7748965)
> "it warns about lots of things ... like documenting the public methods and classes in their APIs"

Only if you're switched on the Generate XML Documentation switch `/doc` (in which case I think it makes sense).

Most places I've worked have /warnaserror as a standard part of the build so that the build fails if there are any warnings (and they can be `#pragma nowarn`-ed out)