[Webkit-unassigned] [Bug 34605] check-webkit-style incorrectly complains about NULL appearing in a comment

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 19 23:30:47 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=34605


David Levin <levin at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ap at webkit.org,
                   |                            |levin at chromium.org




--- Comment #1 from David Levin <levin at chromium.org>  2010-07-19 23:30:47 PST ---
(In reply to comment #0)
> See https://bugs.webkit.org/show_bug.cgi?id=34602
> 
> check-webkit-style reported this:
> 
> Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
> WebCore/platform/network/soup/DNSSoup.cpp:41:  Use 0 instead of NULL. 
> [readability/null] [4]
> Total errors found: 1
> 
> And this is the line it's complaining about:
> 
>  41     // We may get invalid hostnames, so NULL-check here.

fwiw, this check was done this way on purpose. The check was carefully done to include both code and comments but not items in quotes (in code).

 Several experienced reviews have commented on NULL appearing in comments. As I understand it, the reason being that NULL isn't allowed in code so it doesn't make sense in comments. 

For example, the comment could easily have said
  // Check for invalid hostnames.
and seems to talk more about why than what (checking for a 0 value).

Another recent instance is this comment 
  if (hdc) { // Can this ever actually be NULL?
which could have easily been 
  if (hdc) { // Can hdc ever actually be 0?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list