diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-05 15:55:36 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-05 15:55:36 +0000 |
commit | 30a845609c490c6babe5748d69bff485aeaf0a46 (patch) | |
tree | e0c9be26c547323831ff1617a49ac4a49d471400 /usr.bin/make | |
parent | e87f107141acec869976583249f42fd44e68e62e (diff) | |
download | src-30a845609c490c6babe5748d69bff485aeaf0a46.tar.gz src-30a845609c490c6babe5748d69bff485aeaf0a46.zip |
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
Notes
Notes:
svn path=/head/; revision=239071
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/var.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 477c4a906bce..7cde060f2dda 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1765,7 +1765,7 @@ ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freeResult) 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( |