Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Dec 2013 21:44:14 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259045 - head/sys/conf
Message-ID:  <201312062144.rB6LiENS041686@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Dec  6 21:44:13 2013
New Revision: 259045
URL: http://svnweb.freebsd.org/changeset/base/259045

Log:
  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

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==============================================================================
--- head/sys/conf/kern.mk	Fri Dec  6 21:39:45 2013	(r259044)
+++ head/sys/conf/kern.mk	Fri Dec  6 21:44:13 2013	(r259045)
@@ -148,6 +148,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
 #
 .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312062144.rB6LiENS041686>