Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src sys: Build kernel with -Wno-type-limits.



details:   https://anonhg.NetBSD.org/src/rev/9e65c18677ec
branches:  trunk
changeset: 368764:9e65c18677ec
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 03 09:37:36 2022 +0000

description:
sys: Build kernel with -Wno-type-limits.

The type-limits warning is actively harmful because it discourages
writing safe portable overflow detection logic which happens, on some
architectures, to be dead code.

diffstat:

 share/mk/bsd.kmodule.mk    |  3 ++-
 sys/conf/Makefile.kern.inc |  3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r bfe3e0d9769c -r 9e65c18677ec share/mk/bsd.kmodule.mk
--- a/share/mk/bsd.kmodule.mk   Wed Aug 03 05:29:04 2022 +0000
+++ b/share/mk/bsd.kmodule.mk   Wed Aug 03 09:37:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.kmodule.mk,v 1.79 2022/07/17 14:10:55 riastradh Exp $
+#      $NetBSD: bsd.kmodule.mk,v 1.80 2022/08/03 09:37:36 riastradh Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -36,6 +36,7 @@
 # XXX until the kernel is fixed again...
 CFLAGS+=       -fno-strict-aliasing
 CWARNFLAGS+=   -Wno-pointer-sign -Wno-attributes
+CWARNFLAGS+=   -Wno-type-limits
 CWARNFLAGS.gcc+=       ${GCC_NO_ADDR_OF_PACKED_MEMBER}
 CWARNFLAGS.clang+=     -Wno-error=address-of-packed-member
 
diff -r bfe3e0d9769c -r 9e65c18677ec sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Wed Aug 03 05:29:04 2022 +0000
+++ b/sys/conf/Makefile.kern.inc        Wed Aug 03 09:37:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.293 2022/01/06 17:05:32 christos Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.294 2022/08/03 09:37:37 riastradh Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -82,6 +82,7 @@
 CWARNFLAGS+=   -Wno-unreachable-code
 #CWARNFLAGS+=  -Wc++-compat -Wno-error=c++-compat
 CWARNFLAGS+=   -Wno-pointer-sign -Wno-attributes
+CWARNFLAGS+=   -Wno-type-limits
 .  if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
        ${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep"
 CWARNFLAGS+=   -Wextra -Wno-unused-parameter



Home | Main Index | Thread Index | Old Index