From 18c2eecf34433a3e986bbd4b72fc03c800c47ac4 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Wed, 16 Sep 2009 13:47:47 +0200 Subject: [PATCH] enable WARNS_WERROR by default This is to catch new warnings sneaking into buildworld. WARNS_WERROR means that -Werror is added to sources iff compiled with WARNS >= 1. All these sources have been fixed to currently compile without warnings. Setting WARNS_WERROR helps us to maintain this status. If your build should fail with a warning treated as error, you either have introduced a new warning - in which case you will have to fix it before committing - or you are using CFLAGS that exhibit warnings which have not been fixed yet - in that case you should try and fix the warning nevertheless. *Only* if you are using compile flags which produce excess warnings, you should disable WARNS_WERROR by setting NO_WERROR in make.conf. If you do, make *absolutely* sure that you don't introduce new warnings into the build, since it will break the build for everybody else who does not set NO_WERROR! Discussed-with: swildner@ --- etc/defaults/make.conf | 3 ++- share/man/man5/make.conf.5 | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf index cbf95e369b..065de824ef 100644 --- a/etc/defaults/make.conf +++ b/etc/defaults/make.conf @@ -69,7 +69,8 @@ BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \ -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings # # WARNS_WERROR causes -Werror to be added when WARNS is in effect. -#WARNS_WERROR= yes +# Set NO_WERROR to disable. +WARNS_WERROR= yes # # To compile just the kernel with special optimizations, you should use # this instead of CFLAGS (which is not applicable to kernel builds anyway). diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index 36de3b5dc6..c0e0f2f962 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -202,6 +202,12 @@ Causes to be added to .Va CWARNFLAGS when WARNS is in effect. +.Va WARNS_WERROR +is enabled by default. +Set +.Va NO_WERROR +to disable +.Fl Werror . .It Va WANT_HESIOD .Pq Vt bool Set this to build @@ -213,6 +219,13 @@ Set this to disable name caching in the nsswitch subsystem. The generic caching daemon, .Xr nscd 8 , will not be built either if this option is set. +.It Va NO_WERROR +Set this if you don't want +.Fl Werror +to be added to +.Va CWARNFLAGS . +See also +.Va WARNS_WERROR . .It Va STATIC_LOCALES .Pq Vt str Set to a list of locales to build into statically-linked binaries. -- 2.41.0