Bug 32125 - [check-webkit-style] strcmp should be excepted from readability/comparison_to_zero
Summary: [check-webkit-style] strcmp should be excepted from readability/comparison_to...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 11:01 PST by Adam Barth
Modified: 2009-12-16 21:13 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2009-12-03 11:01:35 PST
Comment #7 From WebKit Review Bot 2009-12-03 10:36:46 PST (-) [reply] 
Attachment 44255 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/platform/KURL.cpp:637:  Tests for true/false, null/non-null, and
zero/non-zero should all be done without equality comparisons. 
[readability/comparison_to_zero] [5]
Total errors found: 1

 Comment #8 From Alexey Proskuryakov 2009-12-03 10:41:21 PST (-) [reply] 
I think that strcmp comparisons should be an exception to the rule, but I can
change this when landing if a reviewer tells me to.

https://bugs.webkit.org/show_bug.cgi?id=32085#c8
Comment 1 Alexey Proskuryakov 2009-12-03 11:12:41 PST
We should probably discuss this on webkit-dev first, as the current rules don't allow for such exception.
Comment 2 David Levin 2009-12-16 12:11:03 PST
It has been two week with no discussion on webkit-dev to approve this, so I'm resolving as this bug as invalid.

Feel free to reactivate if that discussion happens and this is approved.

fwiw, I like comparing to 0/NULL for all appropriate items, but it is WebKit style to not to do this and !a is logically equivalent to a == 0 so that's that :)
Comment 3 Alexey Proskuryakov 2009-12-16 21:13:18 PST
I e-mailed webkit-dev now.