================
@@ -0,0 +1,57 @@
+// RUN: %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=true \
+// RUN: -analyzer-config
core.CallAndMessage:ArgPointeeInitializednessComplete=true \
+// RUN: -analyzer-config core.CallAndMessage:ArgInitializedness=false
+
+// RUN: %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=true \
+// RUN: -analyzer-config core.CallAndMessage:ArgInitializedness=false
+
+typedef __typeof(sizeof(int)) size_t;
+typedef __WCHAR_TYPE__ wchar_t;
+typedef __CHAR16_TYPE__ char16_t;
+typedef long time_t;
+typedef struct {
+ int x;
+ int y;
+} mbstate_t;
+struct tm {
+ int x;
+ int y;
+};
+extern size_t mbrlen(const char *restrict, size_t, mbstate_t *restrict);
+extern size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict src,
+ size_t nwc, size_t len, mbstate_t *restrict ps);
+extern size_t mbrtoc16(char16_t *restrict pc16, const char *restrict s,
+ size_t n, mbstate_t *restrict ps);
+extern time_t mktime(struct tm *timeptr);
+
+void uninit_mbrlen(const char *mbs) {
+ mbstate_t state;
+ mbrlen(mbs, 1, &state); // expected-warning{{3rd function call argument
points to an uninitialized value}}
----------------
NagyDonat wrote:
(CallAndMessage checker suffers from _many_ issues. AFAIK it was not cleaned up
because it produces lots of reports and changing them would disturb the
workflow of the users, but _eventually_ we should do something because it's
frankly a bit embarrassing. Of course this is completely out of scope for this
commit under review.)
https://github.com/llvm/llvm-project/pull/173854
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits