[PATCH] D47105: Fix compiler warning of extraneous parentheses
Tom Rix via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 19 08:25:01 PDT 2018
trixirt created this revision.
trixirt added reviewers: bkramer, resistor.
Herald added a subscriber: llvm-commits.
Building with clang 5 produces this warning
...lib/Support/regengine.inc:706:13: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if (((st) == (fresh)))
Inspection of the EQ macro shows that the ()'s in the if-check are not needed.
Repository:
rL LLVM
https://reviews.llvm.org/D47105
Files:
lib/Support/regengine.inc
Index: lib/Support/regengine.inc
===================================================================
--- lib/Support/regengine.inc
+++ lib/Support/regengine.inc
@@ -703,7 +703,8 @@
/* next character */
lastc = c;
c = (p == m->endp) ? OUT : *p;
- if (EQ(st, fresh))
+ /* EQ has ()'s, so another set for 'if' is not necessary */
+ if EQ(st, fresh)
coldp = p;
/* is there an EOL and/or BOL between lastc and c? */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47105.147667.patch
Type: text/x-patch
Size: 432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180519/b335662c/attachment.bin>
More information about the llvm-commits
mailing list