<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 --- - ccc-analyzer filters too many compiler flags for Pre-Compiled Headers"
   href="http://llvm.org/bugs/show_bug.cgi?id=16413">16413</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ccc-analyzer filters too many compiler flags for Pre-Compiled Headers
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>kmowery@gmail.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>Created <span class=""><a href="attachment.cgi?id=10735" name="attach_10735" title="ccc-analyzer patch to resolve this bug">attachment 10735</a> <a href="attachment.cgi?id=10735&action=edit" title="ccc-analyzer patch to resolve this bug">[details]</a></span>
ccc-analyzer patch to resolve this bug

If ccc-analyzer is run as part of a compilation which includes pre-compiled
header files, the analyze clang invocation fails with errors like these:

error: const-qualified string support was enabled in PCH file but is currently
disabled
error: __OPTIMIZE__ predefined macro was enabled in PCH file but is currently
disabled
error: exception handling was disabled in PCH file but is currently enabled
error: run-time type information was disabled in PCH file but is currently
enabled

To solve these problems, ccc-analyzer needs to pass along the following flags:
-Wwrite-string (since this actually implies -fconst-strings)
any -O level
all -f flags

This is perhaps not an exhaustive list, but I am able to complete an analysis
of WebKit by including these flags.

I have attached a diff (generated by git) against ccc-analyzer (clang-3.2)
which should fix these issues.

I believe clang-3.3 suffers from the same issues, but other bugs are preventing
me from fully testing it currently.</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>