================
@@ -0,0 +1,328 @@
+// RUN: %clang_analyze_cc1 -verify %s \
+// RUN:   -analyzer-checker=core,unix.Stream,alpha.security.taint \
+// RUN:   -analyzer-checker=debug.ExprInspection
+
+#define EOF (-1)
+
+extern "C" {
+typedef __typeof(sizeof(int)) size_t;
+typedef struct _FILE FILE;
+
+FILE *fopen(const char *filename, const char *mode);
+int fclose(FILE *stream);
+size_t fread(void *buffer, size_t size, size_t count, FILE *stream);
+int fgetc(FILE *stream);
+void *malloc(size_t size);
+}
----------------
NagyDonat wrote:

This test file is written as `.cpp` file, but it's testing plain C 
functionality and it uses `fread`, `malloc` etc. as if it was plain C code 
(under C++, `<cstdio>` and `<cstdlib>` declares these as `std::fread`, 
`std::malloc`...).

This doesn't cause any problems right now, but it'd be better to turn this into 
a `.c` file and include one of the "standard" system header emulator files 
instead of re-declaring these functions at the top of this testcase.

https://github.com/llvm/llvm-project/pull/93408
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to