[clang] [clang][analyzer] CallAndMessage warnings at pointer to uninitialized struct (PR #164600)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 02:24:06 PDT 2025


================
@@ -24,6 +24,18 @@ void pointee_uninit(void) {
   doStuff_pointerToConstInt(p); // expected-warning{{1st function call argument is a pointer to uninitialized value [core.CallAndMessage]}}
 }
 
+typedef struct S {
+  int a;
+  short b;
+} S;
+
+void doStuff_pointerToConstStruct(const S *s){};
+void pointee_uninit_struct(void) {
+  S s;
+  S *p = &s;
+  doStuff_pointerToConstStruct(p); // expected-warning{{1st function call argument is a pointer to uninitialized value [core.CallAndMessage]}}
----------------
balazske wrote:

Yes, this was not detected before.

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


More information about the cfe-commits mailing list