Re:My favorite C compiler flags during development
by account42 on Thursday May 04, 2023 @08:01AM
(#35814035)
> If the aim is no warnings, and that can even be a hard rule, then you also want to add -Werror to treat all warnings as errors
Hard disagree. No warnings means CI should fail (or otherwise scream loudly), not every build of your in-progress working tree. You can add a commit hook if you want but if it needs to be enforced then it isn't really discipline.
Even for CI you probably don't want -Werror but instead run the build completely so that you can track all warnings.
And for source released to others -Werror is downright rude as you have no idea what warnings their possible future compiler will have.
Hard disagree. No warnings means CI should fail (or otherwise scream loudly), not every build of your in-progress working tree. You can add a commit hook if you want but if it needs to be enforced then it isn't really discipline.
Even for CI you probably don't want -Werror but instead run the build completely so that you can track all warnings.
And for source released to others -Werror is downright rude as you have no idea what warnings their possible future compiler will have.