<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62787>62787</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
ccc-analyzer doesn't honor "--include <header.h>" as clang does
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
HclX
</td>
</tr>
</table>
<pre>
I ran into problem when using clang checker for some project. And it turned out to be an issue that ccc-analyzer doesn't hornor the "--include <header.h>" command line options. Here is a minimized example:
Source code, referring an non-existing header file if `TEST` is not defined:
```
user@home:~/Source$ cat bar.c
#include <stdio.h>
#ifdef TEST
#else
#include <not_exist.h>
#endif
int main(int argc, char* argv[]) {
return 0;
}
user@home:~/Source$ ls not_exist.h
ls: cannot access 'not_exist.h': No such file or directory
```
`TEST` is defined by a header file and included using the "--include" command line args. Clang builds without problem:
```
user@home:~/Source$ cat bar.h
#define TEST
user@home:~/Source$ clang bar.c --include bar.h
```
However, the same command line will not work for `ccc-analyzer`:
```
user@home:~/Source$ $(dirname $(which clang))/../libexec/ccc-analyzer bar.c --include bar.h
bar.c:4:10: fatal error: 'not_exist.h' file not found
#include <not_exist.h>
^~~~~~~~~~~~~
1 error generated.
Use of uninitialized value $HtmlDir in concatenation (.) or string at /usr/libexec/ccc-analyzer line 152, <$fh> line 4.
mkdir /failures: Permission denied at /usr/libexec/ccc-analyzer line 153.
```
This is the version of my clang tool:
```
user@home:~/Source$ $(dirname $(which clang))/../libexec/ccc-analyzer --version
Android (9394278, based on r475365b) clang version 16.0.2 (https://android.googlesource.com/toolchain/llvm-project e1a2893d16330144736de1f4f0d06a844a03b9b0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVs1u2zgQfhr6MrAgkbJkH3xwkxrZy2KBdoG9FRQ5krihyICkYqeHPvtiJKWx0zbdn8MGghDS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