<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61699>61699</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Ignoring or handling GCC's -fno-canonical-system-headers in tooling
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          cpsauer
      </td>
    </tr>
</table>

<pre>
    Hi wonderful LLVM folks,

I maintain [the tool that generates compile_commands.json databases](https://github.com/hedronvision/bazel-compile-commands-extractor) from Bazel--a build system by Google--for use with clang tooling, like clangd and clang-tidy. Those build commands sometimes contain calls to gcc, especially on Linux, and clang tooling recognizes almost all aspects of those gcc commands, except...

I kept hearing from users that the they were seeing spurious errors for `-fno-canonical-system-headers` (which clang doesn't recognize). Would you be down to ignore (or handle) that driver flag, at least for tooling, so it isn't treated as an error?

Some users had manually worked around this until we added functionality to auto-strip it from commands, but longer term, it seems like it'd make sense to have clang (tooling) handle the flag to avoid folks running into this from each build system.

Thanks,
Chris

P.S. One user had filed an issue about this over at clangd, with some more details, in case that's useful https://github.com/clangd/clangd/issues/1004. @HighCommander4 had suggest we refile over here, and request the clang:driver label, so I'm following up and doing that on their behalf.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8lU-P2zYQxT8NfRlIkGXLfw4-JBtsEiBFCyRoj8VIHIvMUhyXHK7jfPqClJw4l1x2ZZl8fPN7MzTGaEdPdFLdW9W9W2ESw-E0XCImCque9e30wcKVvaZwTg4-ffr7Dzize4mqfVLNO9W8mf9-hAmtF7QeVPdWDIEwOxCDAiN5CigUYeDpYh39O_A0odex_hrZg0bBHiNF1b1T7cGIXKLavFHts2qfRysm9fXAk2qfDenA_tVGy161zz1-J1ctotVdtKJvEnAQDqo9wjnwBG_LwgqhT9ZpiLcoNEF_g_fMo6OqOnOAFAmuVgwM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