From owner-svn-src-head@FreeBSD.ORG Sun Aug 5 15:55:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66FF11065672; Sun, 5 Aug 2012 15:55:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50F788FC18; Sun, 5 Aug 2012 15:55:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q75FtbVd099803; Sun, 5 Aug 2012 15:55:37 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q75Ftbaa099801; Sun, 5 Aug 2012 15:55:37 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208051555.q75Ftbaa099801@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Aug 2012 15:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239071 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2012 15:55:37 -0000 Author: dim Date: Sun Aug 5 15:55:36 2012 New Revision: 239071 URL: http://svn.freebsd.org/changeset/base/239071 Log: In usr.bin/make/var.c, function ParseModifier(), initialize the 'error' variable to NULL, to avoid using it uninitialized in certain cases. This fixes the following clang 3.2 warning: usr.bin/make/var.c:1770:10: error: variable 'error' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (vp->execute) { ^~~~~~~~~~~ usr.bin/make/var.c:1777:10: note: uninitialized use occurs here if (error) ^~~~~ usr.bin/make/var.c:1770:6: note: remove the 'if' if its condition is always true if (vp->execute) { ^~~~~~~~~~~~~~~~~ usr.bin/make/var.c:1768:23: note: initialize the variable 'error' to silence this warning const char *error; ^ = NULL MFC after: 1 week Modified: head/usr.bin/make/var.c Modified: head/usr.bin/make/var.c ============================================================================== --- head/usr.bin/make/var.c Sun Aug 5 15:40:16 2012 (r239070) +++ head/usr.bin/make/var.c Sun Aug 5 15:55:36 2012 (r239071) @@ -1765,7 +1765,7 @@ ParseModifier(VarParser *vp, char startc if ((vp->ptr[0] == 's') && (vp->ptr[1] == 'h') && (vp->ptr[2] == endc || vp->ptr[2] == ':')) { - const char *error; + const char *error = NULL; if (vp->execute) { newStr = Buf_Peel(