<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>34605</bug_id>
          
          <creation_ts>2010-02-04 10:57:17 -0800</creation_ts>
          <short_desc>check-webkit-style incorrectly complains about NULL appearing in a comment</short_desc>
          <delta_ts>2010-07-20 00:17:42 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gustavo Noronha (kov)">gustavo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>levin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>187864</commentid>
    <comment_count>0</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2010-02-04 10:57:17 -0800</bug_when>
    <thetext>See https://bugs.webkit.org/show_bug.cgi?id=34602

check-webkit-style reported this:

Failed to run &quot;WebKitTools/Scripts/check-webkit-style&quot; 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&apos;s complaining about:

 41     // We may get invalid hostnames, so NULL-check here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253573</commentid>
    <comment_count>1</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2010-07-19 23:30:47 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; See https://bugs.webkit.org/show_bug.cgi?id=34602
&gt; 
&gt; check-webkit-style reported this:
&gt; 
&gt; Failed to run &quot;WebKitTools/Scripts/check-webkit-style&quot; exit_code: 1
&gt; WebCore/platform/network/soup/DNSSoup.cpp:41:  Use 0 instead of NULL. 
&gt; [readability/null] [4]
&gt; Total errors found: 1
&gt; 
&gt; And this is the line it&apos;s complaining about:
&gt; 
&gt;  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&apos;t allowed in code so it doesn&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253583</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-07-20 00:17:42 -0700</bug_when>
    <thetext>Yes, I agree that this particular comment needn&apos;t mention null check at all. And we do prefer to talk about null or 0 when necessary.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>