[clang] [clang][analyzer] StreamChecker: Model getc, vfscanf, putc, vfprintf (PR #82476)

Alejandro Álvarez Ayllón via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 00:14:14 PST 2024


================
@@ -5,7 +5,7 @@
 // suppressed.
 #pragma clang system_header
 
-typedef struct __sFILE {
----------------
alejandro-alvarez-sonarsource wrote:

I had to modify this line after adding `vfscanf` (and now `vfprintf`) to `system-header-simulator-for-valist.h`
The reason is that they need the `FILE*` typedef and they have to be consistent with the typedef of `system-header-simulator.h` since they are used together.

But `system-header-simulator-for-valist.h` was already used together with `system-header-simulator-for-simple-stream.h` in [`security-syntax-checks.m`](https://github.com/llvm/llvm-project/blob/main/clang/test/Analysis/security-syntax-checks.m).

So I had to change something to keep them consistent, and `typedef struct _FILE FILE;` seems to be used more commonly over the tests.

https://github.com/llvm/llvm-project/pull/82476


More information about the cfe-commits mailing list