summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2018-10-16 18:42:20 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-14 13:48:02 +0800
commitf97aaf80dd44e92f2cabc7e6d92d461f4fe6eddd (patch)
tree4cee6999fbca8902f21dc48832174e4505a6060b
parentshell: Enable automake silent rules (diff)
downloaddash-f97aaf80dd44e92f2cabc7e6d92d461f4fe6eddd.tar.gz
dash-f97aaf80dd44e92f2cabc7e6d92d461f4fe6eddd.zip
eval: Silence compiler warning about missing parentheses
Gcc gives a warning about some missing parentheses:

-----------------------------------------------------------------------
eval.c: In function ‘evaltree’:
eval.c:282:15: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
   if (!status == isor || evalskip)
               ^~
eval.c:282:7: note: add parentheses around left hand side expression to silence this warning
   if (!status == isor || evalskip)
       ^~~~~~~
       (      )
-----------------------------------------------------------------------

Add the parentheses to silence the warning.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--src/eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index dde9fa2..943948a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -279,7 +279,7 @@ checkexit:
 		isor = n->type - NAND;
 		status = evaltree(n->nbinary.ch1,
 				  (flags | ((isor >> 1) - 1)) & EV_TESTED);
-		if (!status == isor || evalskip)
+		if ((!status) == isor || evalskip)
 			break;
 		n = n->nbinary.ch2;
 evaln: