Page MenuHomePhabricator

Fix compiler warning of extraneous parentheses
Needs ReviewPublic

Authored by trixirt on May 19 2018, 8:24 AM.

Details

Summary

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.

Diff Detail

Event Timeline

trixirt created this revision.May 19 2018, 8:24 AM
xbolva00 added a subscriber: xbolva00.EditedMay 19 2018, 9:22 AM

Please upload patch with full context

trixirt updated this revision to Diff 147678.May 19 2018, 1:07 PM

More content.

This doesn't have a huge scope to worry about so maybe thinking about it this hard is unnecessary: but I'm sort of undecided what the "right thing" to do here is, seems like maybe clang shouldn't warn on a construct like this? but that's a lot to do for a tiny case like this that hasn't come up elsewhere...

This change fixes one of the few build warnings.
The extra parenthesis warning is noisy.
I agree there isn't an obvious best path.
I commented the code for this reason.