]> git.ipfire.org Git - thirdparty/bind9.git/commit
Set WarningLevel to Level1 for Release, treat warnings as errors
authorOndřej Surý <ondrej@isc.org>
Wed, 8 Apr 2020 08:58:45 +0000 (10:58 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 16 Apr 2020 06:12:39 +0000 (08:12 +0200)
commit1eb5a77baa480010a0cefd148a95cfe0338ea6fc
treec764a0d654e0d9d3ce85a31062303b249bed3ff1
parent385fd98bf11e09a8b3e86fe7c711a1b72cdbda14
Set WarningLevel to Level1 for Release, treat warnings as errors

Our vcxproj files set the WarningLevel to Level3, which is too verbose
for a code that needs to be portable.  That basically leads to ignoring
all the errors that MSVC produces.  This commits downgrades the
WarningLevel to Level1 and enables treating warnings as errors for
Release builds.  For the Debug builds the WarningLevel got upgraded to
Level4, and treating warnings as errors is explicitly disabled.

We should eventually make the code clean of all MSVC warnings, but it's
a long way to go for Level4, so it's more reasonable to start at Level1.

For reference[1], these are the warning levels as described by MSVC
documentation:

  * /W0 suppresses all warnings. It's equivalent to /w.
  * /W1 displays level 1 (severe) warnings. /W1 is the default setting
    in the command-line compiler.
  * /W2 displays level 1 and level 2 (significant) warnings.
  * /W3 displays level 1, level 2, and level 3 (production quality)
    warnings. /W3 is the default setting in the IDE.
  * /W4 displays level 1, level 2, and level 3 warnings, and all level 4
    (informational) warnings that aren't off by default. We recommend
    that you use this option to provide lint-like warnings. For a new
    project, it may be best to use /W4 in all compilations. This option
    helps ensure the fewest possible hard-to-find code defects.
  * /Wall displays all warnings displayed by /W4 and all other warnings
    that /W4 doesn't include — for example, warnings that are off by
    default.
  * /WX treats all compiler warnings as errors. For a new project, it
    may be best to use /WX in all compilations; resolving all warnings
    ensures the fewest possible hard-to-find code defects.

1. https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=vs-2019

(cherry picked from commit 789d253e3d0792c177476cb899933aa08415f20a)
71 files changed:
bin/check/win32/checkconf.vcxproj.in
bin/check/win32/checktool.vcxproj.in
bin/check/win32/checkzone.vcxproj.in
bin/confgen/win32/confgentool.vcxproj.in
bin/confgen/win32/ddnsconfgen.vcxproj.in
bin/confgen/win32/rndcconfgen.vcxproj.in
bin/delv/win32/delv.vcxproj.in
bin/dig/win32/dig.vcxproj.in
bin/dig/win32/dighost.vcxproj.in
bin/dig/win32/host.vcxproj.in
bin/dig/win32/nslookup.vcxproj.in
bin/dnssec/win32/dnssectool.vcxproj.in
bin/dnssec/win32/dsfromkey.vcxproj.in
bin/dnssec/win32/importkey.vcxproj.in
bin/dnssec/win32/keyfromlabel.vcxproj.in
bin/dnssec/win32/keygen.vcxproj.in
bin/dnssec/win32/revoke.vcxproj.in
bin/dnssec/win32/settime.vcxproj.in
bin/dnssec/win32/signzone.vcxproj.in
bin/dnssec/win32/verify.vcxproj.in
bin/named/win32/named.vcxproj.in
bin/nsupdate/win32/nsupdate.vcxproj.in
bin/pkcs11/win32/pk11destroy.vcxproj.in
bin/pkcs11/win32/pk11keygen.vcxproj.in
bin/pkcs11/win32/pk11list.vcxproj.in
bin/pkcs11/win32/pk11tokens.vcxproj.in
bin/rndc/win32/rndc.vcxproj.in
bin/rndc/win32/rndcutil.vcxproj.in
bin/tests/system/win32/bigkey.vcxproj.in
bin/tests/system/win32/feature-test.vcxproj.in
bin/tests/system/win32/gencheck.vcxproj.in
bin/tests/system/win32/keycreate.vcxproj.in
bin/tests/system/win32/keydelete.vcxproj.in
bin/tests/system/win32/lwtest.vcxproj.in
bin/tests/system/win32/pipequeries.vcxproj.in
bin/tests/win32/backtrace_test.vcxproj.in
bin/tests/win32/inter_test.vcxproj.in
bin/tests/win32/makejournal.vcxproj.in
bin/tests/win32/rwlock_test.vcxproj.in
bin/tests/win32/shutdown_test.vcxproj.in
bin/tests/win32/sock_test.vcxproj.in
bin/tests/win32/task_test.vcxproj.in
bin/tests/win32/timer_test.vcxproj.in
bin/tools/win32/arpaname.vcxproj.in
bin/tools/win32/genrandom.vcxproj.in
bin/tools/win32/ischmacfixup.vcxproj.in
bin/tools/win32/journalprint.vcxproj.in
bin/tools/win32/mdig.vcxproj.in
bin/tools/win32/nsec3hash.vcxproj.in
bin/tools/win32/rrchecker.vcxproj.in
bin/win32/BINDInstall/BINDInstall.vcxproj.in
doc/xsl/graphics/caution.eps
doc/xsl/graphics/important.eps
doc/xsl/graphics/note.eps
doc/xsl/graphics/tip.eps
doc/xsl/graphics/warning.eps
lib/bind9/win32/libbind9.vcxproj.in
lib/dns/win32/gen.vcxproj.in
lib/dns/win32/libdns.vcxproj.in
lib/irs/win32/libirs.vcxproj.in
lib/isc/win32/libisc.vcxproj.in
lib/isccc/win32/libisccc.vcxproj.in
lib/isccfg/win32/libisccfg.vcxproj.in
lib/lwres/win32/liblwres.vcxproj.in
lib/samples/win32/async.vcxproj.in
lib/samples/win32/gai.vcxproj.in
lib/samples/win32/nsprobe.vcxproj.in
lib/samples/win32/request.vcxproj.in
lib/samples/win32/resolve.vcxproj.in
lib/samples/win32/update.vcxproj.in
lib/win32/bindevt/bindevt.vcxproj.in