<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Feature request: warn on possibly-infinite loops without sequence points"
   href="http://llvm.org/bugs/show_bug.cgi?id=15527">15527</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Feature request: warn on possibly-infinite loops without sequence points
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>juli@clockworksquid.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It is common in threaded code to see things like "while (foo->bar) continue;"
where bar is a field of the struct pointed to by foo which is expected to be
changed in another thread (or on signal, or ...)  Usually, correct
implementations would have an unlock and a relock (or ideally a block on a
condition variable), thus putting a sequence point within the loop and
requiring the compiler to reload the value of foo->bar over and over again, or
bar or foo may be declared volatile, however occasionally implementations that
are so simplistic do occur.

I would like to see the static analyzer detect these conditions, namely by
detecting that a loop conditional will only be checked once, and then will
either proceed or will reliably enter into an infinite loop.</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>