<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:jordan_rose@apple.com" title="Jordan Rose <jordan_rose@apple.com>"> <span class="fn">Jordan Rose</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - alpha.core.BoolAssignment doesn't work as expected"
   href="http://llvm.org/bugs/show_bug.cgi?id=18328">bug 18328</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>jordan_rose@apple.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - alpha.core.BoolAssignment doesn't work as expected"
   href="http://llvm.org/bugs/show_bug.cgi?id=18328#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - alpha.core.BoolAssignment doesn't work as expected"
   href="http://llvm.org/bugs/show_bug.cgi?id=18328">bug 18328</a>
              from <span class="vcard"><a class="email" href="mailto:jordan_rose@apple.com" title="Jordan Rose <jordan_rose@apple.com>"> <span class="fn">Jordan Rose</span></a>
</span></b>
        <pre>alpha.core.BoolAssignment was intended to catch unsafe uses of fake boolean
variables, like Boolean or BOOL, which are actually typedef'd to some form of
char. These are dangerous because (BOOL)256 performs a truncation, not a truth
test, and so the value you get is 0 (false). (bool)256, on the other hand, will
actually compare 256 to 0, and correctly record the value 'true'.

You could argue that there should be a warning for any sort of int-to-bool
conversion where the int isn't known a priori to be 1 or 0, but that wasn't
really the motivation for the checker.

Finally, though, alpha checkers aren't considered real shipping products, so
it's not really worth filing bugs on them unless someone is actively working on
them.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>