Hacker News new | ask | show | jobs
by anyfoo 421 days ago
And I don't think there's an excuse not to. I work on giant projects with tons of people, that still manage to use -Werror.

Yeah, some warnings are turned off, but not as many as you'd think, and usually for good reasons, which also includes deliberate design decisions. For example, we don't care about pre-C11 compatibility (because we won't build for pre-C11), so that warning is off. We also like 0-sized arrays, so that warning is off as well.

It's a moving target, because compiler engineers add new warnings over time. Adapting the new compiler means taking care of the new warnings. There's almost always a way to do so instead of turning a new warning off.

1 comments

The person who writes the library isn't using the same compiler as you.
True, so?
So turn on -Werror in your CI builds, but don't turn it on for all builds.
I mean, yeah, obviously that a)only works when we build our projects ourselves, and b) for external libraries you have less control over that.
Fuck projects that ship conpile scripts with -Werror.
I don't understand this discussion. What I said was that for our big projects internally, we keep them warning-free, and -Werror obviously helps tremendously with that. Nobody said you need to ship externally with -Werror, or anything about external libraries the project may be using.

By keeping your own project warning-free in your environment, you are doing a service to everyone.