5 ms·
If you're working in a controlled environment, such as proprietary software with a fixed number of toolchains or a few OSS projects like Chromium that use their
by r2vcap 3y ago
If you're working in a controlled environment, such as proprietary software with a fixed number of toolchains or a few OSS projects like Chromium that use their own fixed toolchain, then it makes sense to turn on -Werror. However, most OSS projects deal with tons of different compilers, so it is not possible to enforce -Werror, as different compilers and versions handle warnings differently.
- soulbadguy 3y agoit takes a bit of discipline, but i think it is entirely possible. Even when some OSS project support a lot of different build environment, the support is usually tiered with some of the target having daily or per commit builds. Those should be setup with -Werror + exceptions where it makes sense. Once a project get to stable state (as in for a given target, all the warning are either turned off, or handled). Upgrading or adding new target get easier.
- saagarjha 3y agoEven projects with a “stable” set of targets have too much churn for this to be practical. Just because you support “latest macOS” doesn’t mean my build should fail if I’m on a beta build ahead.
- soulbadguy 3y ago> Even projects with a “stable” set of targets have too much churn for this to be practical. Are you speaking here from experience ? Because mine has been quite different.
- saagarjha 3y agoYes, I typically run toolchains that are slightly ahead or different than the one that is actually used in CI. I don't think it is reasonable to think that projects will be using it, though they often do appreciate me testing it early for them.
- bluGill 3y agoPlease let me know so I can fix issues. Or let the compiler vendor know, sometimes they add something new to get feedback on how useful it is in the real world.
- saagarjha 3y agoThat is what I do. Right after I turn of -Werror so I can get my work done first…
- viraptor 3y agoYou can still use -Werror in your CI on compilers you do support. Just don't enable that flag for everyone else.