From owner-svn-src-all@FreeBSD.ORG Sun Jan 4 20:08:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FFB34A5; Sun, 4 Jan 2015 20:08:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B4B935C2; Sun, 4 Jan 2015 20:08:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t04K8PU6022617; Sun, 4 Jan 2015 20:08:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t04K8P6A022616; Sun, 4 Jan 2015 20:08:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201501042008.t04K8P6A022616@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Jan 2015 20:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276666 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2015 20:08:26 -0000 Author: ian Date: Sun Jan 4 20:08:24 2015 New Revision: 276666 URL: https://svnweb.freebsd.org/changeset/base/276666 Log: Eliminate uninitialized variable warnings in kernel and module builds when building with gcc 4.2 This has been requested several times over the past few months by several people (including me), because gcc 4.2 just gets it wrong too often. It's causing us to litter the code with lots of bogus initializers just to squelch the warnings. We still have clang and coverity telling us about uninitialized variables, and they do so more accurately. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Jan 4 19:55:44 2015 (r276665) +++ head/sys/conf/kern.mk Sun Jan 4 20:08:24 2015 (r276666) @@ -31,7 +31,8 @@ CWARNEXTRA?= -Wno-error-tautological-com -Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40300 +.if ${COMPILER_TYPE} == "gcc" +.if ${COMPILER_VERSION} >= 40300 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. Note: we likely only really "support" # building with gcc 4.8 and newer. Nothing older has been tested. @@ -40,6 +41,10 @@ CWARNEXTRA?= -Wno-error=inline -Wno-erro -Wno-error=array-bounds -Wno-error=address \ -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes \ -Wno-error=strict-overflow -Wno-error=overflow +.else +# For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. +CWARNEXTRA?= -Wno-uninitialized +.endif .endif # External compilers may not support our format extensions. Allow them