diff mbox series

[5/5] Silence compiler warning about missing parentheses

Message ID 20181016164220.29413-6-ao2@ao2.it (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series Build system updates and gcc warnings fixes | expand

Commit Message

Antonio Ospite Oct. 16, 2018, 4:42 p.m. UTC
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>
---
 src/eval.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/eval.c b/src/eval.c
index 6185db4..6f09501 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: