[clang] [clang][analyzer] Update CallDescription of 'tmpfile' & 'fopen' in StreamChecker (PR #70540)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 06:35:32 PDT 2023


================
@@ -0,0 +1,16 @@
+// RUN: %clang_analyze_cc1 -fno-builtin -analyzer-checker=core,alpha.unix.Stream -verify %s
+// expected-no-diagnostics
+
+typedef struct _FILE FILE;
+
+// These functions are not standard C library functions.
+FILE *tmpfile(const char *restrict path);
+FILE *fopen(const char *restrict path);
----------------
steakhal wrote:

```suggestion
// These functions are not standard C library functions.
FILE *tmpfile(const char *restrict path); // Real 'tmpfile' should have exactly 0 formal parameters.
FILE *fopen(const char *restrict path); // Real 'fopen' should have exactly 2 formal parameters.
```

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


More information about the cfe-commits mailing list