<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134535>134535</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] misc-include-cleaner false positive for FILE type header in C89 & C90
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy,
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
abdelmaged
</td>
</tr>
</table>
<pre>
Source C file:
```
#include <stdio.h>
void testFileType(FILE *fp) {
}
```
Using clang-tidy misc-include-cleaner:
```
$ clang-tidy mytest.c -checks=-*,misc-include-cleaner -- -std=c89
2 warnings generated.
mytest.c:1:1: warning: included header stdio.h is not used directly [misc-include-cleaner]
1 | #include <stdio.h>
| ^~~~~~~~~~~~~~~~~~
2 |
mytest.c:3:19: warning: no header providing "FILE" is directly included [misc-include-cleaner]
1 | #include <stdio.h>
2 |
3 | void testFileType(FILE *fp) {
| ^
```
Issue also reproducible in this link:
https://godbolt.org/z/3aWYjhjdb
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVEGPszYQ_TXDZURkxpCEAwc2WaRP6q2tqh4NnoD3czDCJlV66G-vzJL9utGq6qEWCBuGN-_NPFt5b_qRuYLiBYpzopYwuLlSrWZ7VT3rpHX6Xv3slrljPOHFWAZZg6hhL7ZL1EDSjJ1dNCPIkw_auN0A8jV-EvXNGY2BfWiM5V_uEwMdm28_vSJQfZmASoTDSww9nJ9xRf2rN2OPnVVjnwaj73g1vku3bGlnWY08f8Uo__TTPebfdZh2A3ffPchzClQDnb6CwzTF1AcN8twdSxA14R9qHs3Ye-x55FkF1jsQ9QMWZJ1t9yMyTjdYjQMrzTNuhUHjcXQBF88atZm5C_aOULx8Ka2IRUFEzBAOJ_yXUuM61qDi9a_nsQXQe8An7jJyL5_Ij-5Be5rdzejYBiCKjQOiqOGD-ofO_0fDB8W4kOviv1roUwneDfTkp2_eL4zKeoczT7PTS2day2hGDIPxaM34_d1OQwiTj1NqgJre6dbZsHNzD9T8CdRI9dvvb8ObbkHUia6kLmWpEq6yQy7LXIo8S4YqI5113f6gD4U6Xjgv8nZf5PlFFlrq7KgSU5GgQuRin5E8ULajVua8VzpXck-ZKCAXfFXG7qy9XWP6xEQJVSbzQhaJVS1bv25foh-OByKgExBdlPWcTs6bYG4cXxfnZK4iWNouvYdcWOOD_wEfTLDrefAPtOL85b7DFR0f6HhxM65tCfeJH_YxI56OJQLt8VSKZJlt9VRaE4al3XXuCtREGtsjnWb3xl0AalbJHqjZVN8q-jsAAP__VVtyBg">