From 1efe86bb373525ffa08c26c6db94bfc542e96b6d Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 6 Dec 2013 21:44:13 +0000 Subject: [PATCH] Disallow optimizations which potentially remove boundary checks for signed values due to a compiler authors considering integer overflow as impossible. The change follows suit of other projects taking the same measure. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/conf/kern.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 2939a59cb0b..6e6ba92c4db 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -147,6 +147,12 @@ INLINE_LIMIT?= 8000 # CFLAGS+= -ffreestanding +# +# Do not allow a compiler to optimize out overflow checks for signed +# types. +# +CFLAGS+= -fno-strict-overflow + # # GCC SSP support #