Index: Makefile =================================================================== --- Makefile +++ Makefile @@ -459,7 +459,7 @@ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ MAN= -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WERROR \ + -DNO_CPU_CFLAGS MK_WERROR=no \ -DNO_SUBDIR \ DESTDIR= PROGNAME=${MYMAKE:T} Index: Makefile.inc1 =================================================================== --- Makefile.inc1 +++ Makefile.inc1 @@ -731,7 +731,7 @@ SSP_CFLAGS= \ MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WERROR MK_CTF=no \ + -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes @@ -752,7 +752,7 @@ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WERROR MK_CTF=no \ + -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no @@ -780,7 +780,7 @@ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_RETPOLINE=no -DNO_WERROR MK_CTF=no + -DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WERROR=no MK_CTF=no # world stage WMAKEENV= ${CROSSENV} \ @@ -2739,7 +2739,7 @@ MK_SENDMAIL=no \ MK_SVNLITE=no \ MK_TESTS=no \ - -DNO_WERROR \ + MK_WERROR=no \ MK_ZFS=no .if make(native-xtools*) && \ @@ -3358,7 +3358,7 @@ NOFUN=-DNO_FSCHG MK_HTML=no -DNO_LINT \ MK_MAN=no MK_NLS=no MK_PROFILE=no \ - MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no -DNO_WERROR \ + MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WERROR=no \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} Index: Makefile.libcompat =================================================================== --- Makefile.libcompat +++ Makefile.libcompat @@ -104,7 +104,7 @@ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ - MK_CTF=no MK_RETPOLINE=no -DNO_WERROR \ + MK_CTF=no MK_RETPOLINE=no MK_WERROR=no \ ${_t} .endfor .endfor Index: lib/googletest/tests/gmock/Makefile =================================================================== --- lib/googletest/tests/gmock/Makefile +++ lib/googletest/tests/gmock/Makefile @@ -9,6 +9,6 @@ LIBADD+= pthread gtest gmock # The next release will resolve a number of build warnings issues. -NO_WERROR= +MK_WERROR= no .include Index: lib/googletest/tests/gmock_main/Makefile =================================================================== --- lib/googletest/tests/gmock_main/Makefile +++ lib/googletest/tests/gmock_main/Makefile @@ -32,6 +32,6 @@ LIBADD= gmock_main gmock gtest # The next release will resolve a number of build warnings issues. -NO_WERROR= +MK_WERROR= no .include Index: lib/googletest/tests/gtest/Makefile =================================================================== --- lib/googletest/tests/gtest/Makefile +++ lib/googletest/tests/gtest/Makefile @@ -41,6 +41,6 @@ LIBADD.gtest_stress_test+= pthread # The next release will resolve a number of build warnings issues. -NO_WERROR= +MK_WERROR= no .include Index: lib/googletest/tests/gtest_main/Makefile =================================================================== --- lib/googletest/tests/gtest_main/Makefile +++ lib/googletest/tests/gtest_main/Makefile @@ -39,6 +39,6 @@ LIBADD.gtest_unittest+= pthread # The next release will resolve a number of build warnings issues. -NO_WERROR= +MK_WERROR= no .include Index: lib/libalias/libalias/Makefile =================================================================== --- lib/libalias/libalias/Makefile +++ lib/libalias/libalias/Makefile @@ -10,6 +10,6 @@ MAN= libalias.3 SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_mod.c INCS= alias.h -NO_WERROR= +MK_WERROR= no .include Index: lib/libc/tests/ssp/Makefile =================================================================== --- lib/libc/tests/ssp/Makefile +++ lib/libc/tests/ssp/Makefile @@ -2,7 +2,7 @@ .include -NO_WERROR= +MK_WERROR= no WARNS?= 2 CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector Index: lib/libcompiler_rt/Makefile =================================================================== --- lib/libcompiler_rt/Makefile +++ lib/libcompiler_rt/Makefile @@ -15,7 +15,7 @@ # gcc has incompatible internal declarations for __divtc3 and __multc3, but has # no option to silence its warning, so make warnings non-fatal. -NO_WERROR.gcc= +MK_WERROR.gcc= no .include "Makefile.inc" Index: lib/libgcc_s/Makefile =================================================================== --- lib/libgcc_s/Makefile +++ lib/libgcc_s/Makefile @@ -26,7 +26,7 @@ # gcc has incompatible internal declarations for __divtc3 and __multc3, but has # no option to silence its warning, so make warnings non-fatal. -NO_WERROR.gcc= +MK_WERROR.gcc= no LIBCSRCDIR= ${SRCTOP}/lib/libc LIBMSRCDIR= ${SRCTOP}/lib/msun/src Index: share/man/man5/style.Makefile.5 =================================================================== --- share/man/man5/style.Makefile.5 +++ share/man/man5/style.Makefile.5 @@ -156,7 +156,7 @@ so that it may be overridden on the command line or in .Xr make.conf 5 . .It -.Dq Li "NO_WERROR= yes" +.Dq Li "MK_WERROR=no" should not be used, it defeats the purpose of .Va WARNS . Index: share/man/man7/build.7 =================================================================== --- share/man/man7/build.7 +++ share/man/man7/build.7 @@ -492,7 +492,7 @@ or .Pa /etc/src.conf or the command line. -.It Va NO_WERROR +.It Va WITHOUT_WERROR If defined, compiler warnings will not cause the build to halt, even if the makefile says otherwise. .It Va WITH_CTF Index: share/mk/bsd.README =================================================================== --- share/mk/bsd.README +++ share/mk/bsd.README @@ -417,7 +417,7 @@ - LINKS - MAN - MLINKS - - NO_WERROR + - MK_WERROR=no - PROGNAME - SRCS - STRIP Index: share/mk/bsd.lib.mk =================================================================== --- share/mk/bsd.lib.mk +++ share/mk/bsd.lib.mk @@ -47,7 +47,9 @@ .if ${MK_ASSERT_DEBUG} == "no" CFLAGS+= -DNDEBUG -NO_WERROR= +# XXX: shouldn't we ensure that !asserts marks potentially unused variables as +# __unused instead of disabling -Werror globally? +MK_WERROR= no .endif .if defined(DEBUG_FLAGS) Index: share/mk/bsd.opts.mk =================================================================== --- share/mk/bsd.opts.mk +++ share/mk/bsd.opts.mk @@ -65,7 +65,8 @@ SSP \ TESTS \ TOOLCHAIN \ - WARNS + WARNS \ + WERROR __DEFAULT_NO_OPTIONS = \ BIND_NOW \ @@ -103,7 +104,8 @@ INSTALLLIB \ MAN \ PROFILE \ - WARNS + WARNS \ + WERROR .if defined(NO_${var}) .error "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." MK_${var}:=no Index: share/mk/bsd.prog.mk =================================================================== --- share/mk/bsd.prog.mk +++ share/mk/bsd.prog.mk @@ -15,7 +15,9 @@ .if ${MK_ASSERT_DEBUG} == "no" CFLAGS+= -DNDEBUG -NO_WERROR= +# XXX: shouldn't we ensure that !asserts marks potentially unused variables as +# __unused instead of disabling -Werror globally? +MK_WERROR= no .endif .if defined(DEBUG_FLAGS) Index: share/mk/bsd.progs.mk =================================================================== --- share/mk/bsd.progs.mk +++ share/mk/bsd.progs.mk @@ -23,7 +23,7 @@ .if defined(PROG) # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_SHARED NO_WERROR PROGNAME SRCS STRIP WARNS + NO_SHARED MK_WERROR PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Index: share/mk/bsd.sys.mk =================================================================== --- share/mk/bsd.sys.mk +++ share/mk/bsd.sys.mk @@ -41,9 +41,9 @@ .if defined(WARNS) .if ${WARNS} >= 1 CWARNFLAGS+= -Wsystem-headers -.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE}) +.if ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no" CWARNFLAGS+= -Werror -.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE} +.endif # ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no" .endif # WARNS >= 1 .if ${WARNS} >= 2 CWARNFLAGS+= -Wall -Wno-format-y2k @@ -120,9 +120,9 @@ .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-format-nonliteral .endif # WARNS <= 3 -.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE}) +.if ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no" CWARNFLAGS+= -Werror -.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE} +.endif # ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no" .endif # WFORMAT > 0 .endif # WFORMAT .if defined(NO_WFORMAT) || defined(NO_WFORMAT.${COMPILER_TYPE}) Index: targets/pseudo/bootstrap-tools/Makefile =================================================================== --- targets/pseudo/bootstrap-tools/Makefile +++ targets/pseudo/bootstrap-tools/Makefile @@ -42,7 +42,7 @@ SSP_CFLAGS= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WERROR MK_CTF=no \ + -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ MK_INCLUDES=yes Index: tools/build/options/WITHOUT_WERROR =================================================================== --- /dev/null +++ tools/build/options/WITHOUT_WERROR @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set this to not treat compiler warnings as errors. +Useful as a temporary workaround when working on fixing compiler warnings. +When set, warnings are still printed in the build log but do not fail the build. Index: usr.bin/drill/Makefile =================================================================== --- usr.bin/drill/Makefile +++ usr.bin/drill/Makefile @@ -9,7 +9,7 @@ SRCS= drill.c drill_util.c error.c root.c work.c \ chasetrace.c dnssec.c securetrace.c CFLAGS+= -I${LDNSDIR} -NO_WERROR= true +MK_WERROR= no MAN= drill.1 LIBADD= ldns crypto Index: usr.bin/kdump/Makefile =================================================================== --- usr.bin/kdump/Makefile +++ usr.bin/kdump/Makefile @@ -17,6 +17,4 @@ CFLAGS+=-DWITH_CASPER .endif -#NO_WERROR?= YES - .include Index: usr.bin/truss/Makefile =================================================================== --- usr.bin/truss/Makefile +++ usr.bin/truss/Makefile @@ -1,6 +1,5 @@ # $FreeBSD$ -#NO_WERROR= PROG= truss SRCS= main.c setup.c syscalls.c Index: usr.sbin/unbound/Makefile.inc =================================================================== --- usr.sbin/unbound/Makefile.inc +++ usr.sbin/unbound/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_WERROR= true +MK_WERROR= no NO_WTHREAD_SAFETY= true PACKAGE= unbound