[Info-vax] [OT?] Should compiler warnings be treated as errors ?
Craig A. Berry
craigberry at nospam.mac.com
Thu Sep 9 20:30:11 EDT 2021
On 9/9/21 12:52 PM, Simon Clubley wrote:
> Interesting article in The Register:
>
> https://www.theregister.com/2021/09/08/compromise_linux_kernel_compiler_warnings/
>
> Linus has modified the Linux build procedures to turn compiler warnings
> into errors. I strongly agree with him and it's the same flag I use on
> my own code.
> What do you think ? Should compiler warnings be treated as errors ?
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.
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.
And of course compiler warnings get escalated to linker errors on VMS,
so what Linux is considering now has effectively already been the case
on VMS for a few decades.
More information about the Info-vax
mailing list