[Info-vax] [OT?] Should compiler warnings be treated as errors ?
plugh
jchimene at gmail.com
Fri Sep 10 18:23:59 EDT 2021
On Friday, September 10, 2021 at 10:35:19 AM UTC-7, Simon Clubley wrote:
> On 2021-09-09, Craig A. Berry <craig... at nospam.mac.com> wrote:
> >
> > Which warnings with which versions of which compilers? gcc and clang
> > have different warnings available and different default warnings (though
> > they do emulate each other to some extent). Presumably some Linux
> > distros have to be able to build with other compilers, possibly from IBM
> > or Intel. The default warnings enabled with each version of each
> > compiler change, usually adding new ones, but sometimes removing
> > warnings that were felt to create more noise than light.
> >
> > So, in general, yes, getting people to pay attention to warnings and fix
> > things is a good idea. But that's not a particularly simple matter for
> > something that is expected to be portable and compiled against various
> > version of numerous compilers.
> >
> Of course, the other way of looking at that is that one compiler might
> be picking up potential problems in your code that another compiler missed.
> > I still routinely see warnings with the ancient DEC/CPQ/HP/HPE/VSI C
> > compiler for code that produces no warnings with current gcc and clang.
> Interesting. Are they "genuine" warnings or nonsense type warnings ?
>
> Thanks to everyone for their responses. Given the general positive
> response here, it makes me wonder why there's such pushback against
> this change among some of the Linux developers.
>
> I know some are taking the short-term (and short-sighted IMO) view
> about the cleanup work required, but those warnings are being issued
> by the compiler for a reason.
> Simon.
>
> --
> Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
> Walking destinations on a map are further away than they appear.
Compromise on WERROR
TL;DR
> Elver proposed a compromise. "The appropriate usecase for -Werror is therefore compile-test focused builds (often done by developers or CI systems).
https://www.theregister.com/2021/09/08/compromise_linux_kernel_compiler_warnings/
There are never enough volunteers for "... the cleanup work required..."
More information about the Info-vax
mailing list