[clang] [clang][analyzer] Improved message of CallAndMessageChecker at calls with uninitialized argument (PR #211038)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 06:16:00 PDT 2026


================
@@ -30,7 +30,7 @@ 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}}
+  mbrlen(mbs, 1, &state); // expected-warning{{3rd function call argument points to an uninitialized value; Function 'mbrlen' expects memory pointed to by this argument to be initialized}}
----------------
NagyDonat wrote:

I would like to dodge this question :sweat_smile: 

In my opinion the whole uniqueing process is a deeply practical heuristic and it is meaningless to speak about it in on a theoretical level.

We need the uniqueing process, because the users would be annoyed if the analyzer would report dozens or hundreds of very similar bug reports -- but from a theoretical POV the analyzer cannot prove that "these two bug reports are actually the same bug". It is often _more likely_ that there is just one coding mistake in the common part, but noting rules out the case that the common part is good, but each report path contains a separate mistake before it.



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


More information about the cfe-commits mailing list