[bind10-dev] Use of -Werror in release tarballs
Robert Edmonds
edmonds at isc.org
Wed Feb 20 17:49:28 UTC 2013
Mukund Sivaraman wrote:
> This is a request for feedback on whether we should include or remove
> -Werror from the release tarballs.
>
> The -Werror compiler flag causes compiler warnings to become errors, and
> aborts the compile. In the BIND 10 master tree, this flag is enabled by
> default when performing compiles. Should we use this flag by default in
> the release tarball too?
>
> The effect of adding this flag is that in case a future version of a
> compiler notices anything that it should warn about (that may or may not
> be a problem) when compiling the stable BIND 10 release, it will abort
> the compile.
according to <http://git.bind10.isc.org/~tester/builder/builder.html>,
BIND10 is being autobuilt with a fairly eclectic mix of compilers, so as
long as those builds are being built with -Werror, i would think you
have a good chance of catching all the real warnings.
i think part of the reason some developers prefer -Werror is that
autoconfiscated projects tend to produce enormous amounts of console
output during the build, so it's nearly impossible to see a warning
unless the build is halted. but BIND10 is using AM_SILENT_RULES, so
this is not really a problem.
you also have the opposite of the "future version" problem: i've
occasionally seen code that doesn't produce any warnings on modern
compilers, but generates spurious warnings on ancient compilers like gcc
<= 4.2 or so, and usually the warnings were along the lines of "...might
be..." and turned out to be wrong; i guess the modern compilers are just
more accurate.
in general i would never favor -Werror by default in release tarballs.
most people compiling from release tarballs are not going to be
packagers or autobuilders or even programmers, and any compiler
diagnostics will be meaningless to them, so building with -Werror just
pointlessly increases the support burden.
but i'm almost exclusively a C programmer and not a C++ programmer, so
maybe there is some good reason i'm missing why -Werror is more useful
for C++ code, or something.
--
Robert Edmonds
edmonds at isc.org
More information about the bind10-dev
mailing list