4/22/2025 at 7:38:30 PM
> And I'd rather keep the library warning free instead of telling the users to switch warnings off.Thank you! Separately, but related: fuck you, Google! (every time I have to deal with protobuf in C++, I curse Google and their "we don't give a shit about signed vs unsigned comparisons").
by hermitdev
4/23/2025 at 12:12:58 AM
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.
by anyfoo
4/23/2025 at 9:14:24 AM
The person who writes the library isn't using the same compiler as you.by immibis
4/23/2025 at 11:06:49 PM
True, so?by anyfoo
4/24/2025 at 7:27:54 AM
So turn on -Werror in your CI builds, but don't turn it on for all builds.by pabs3
4/24/2025 at 9:20:18 AM
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.by anyfoo
4/24/2025 at 10:43:19 PM
Fuck projects that ship conpile scripts with -Werror.by immibis
4/25/2025 at 12:21:01 AM
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.
by anyfoo
4/22/2025 at 9:11:23 PM
I just turn warnings off for protobuf stuff. In general I do that for any code I don't own but have to compile.by fluoridation
4/23/2025 at 1:50:30 AM
3rdparty libs should be treated as -isystem. Otherwise you're just needlessly paying for other's mistakes.by jcelerier
4/23/2025 at 1:51:48 PM
The problem is: it's infectious into the generated code, as well. Is that 3rd party or not? Yes, it was generated by a 3rd party tool, but from, ostensibly, _your_ protobuf file.edit to add: and yes `-isystem` is absolutely a useful tool. If memory serves, though, it doesn't protect from macro or template expansions, though.
by hermitdev