<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Clang fails if run in the presence of GCC PCH files"
   href="https://bugs.llvm.org/show_bug.cgi?id=41579">41579</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang fails if run in the presence of GCC PCH files
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>libclang
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>paul@mad-scientist.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>klimek@google.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When GCC creates its precompiled headers it writes them into a GCC-specific
directory, <file>.gch, because the format is private to GCC.

Unfortunately when clang runs, it looks into the private GCC directory .gch for
precompiled headers as well, it detects the GCC percompiled headers, tries to
read them, and immediately fails because the format is different:

  $ g++ ... -Winvalid-pch --include=foo_pch.h ...
  $

But:

  $ clang++ ... --include=foo_pch.h ...
  error: no suitable precompiled header file found in directory
      './foo_pch.h.gch'
  1 error generated.

I don't want clang to read these precompiled headers: they're for GCC.  And I
don't want to have to create clang's precompiled headers because I'm just using
a tool built with libLLVM that does some code parsing, I don't need (and
actually can't create because this tool doesn't support it) precompiled
headers.

I just want clang to run, include the header file I've listed with my
--include=<foo>.h, and pay no attention to any GCC-specific precompiled headers
that it can't parse anyway.

Is there no option available to clang that will disable searching for PCH?  And
why does clang even try to look at GCC's PCH directory, if it can't parse GCC
PCH files anyway?</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>