[Info-vax] [OT?] Should compiler warnings be treated as errors ?

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Fri Sep 10 13:35:16 EDT 2021


On 2021-09-09, Craig A. Berry <craigberry 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.



More information about the Info-vax mailing list