https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118194
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-12-30 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- The wording is also quite confusing - it should probably say 'dereferencing 'p' would access uninitialized memory'. void bar (const void *); void *foo(int sz) { void *p = malloc(sz); bar(p); return p; } is diagnosed as well. We have duplicates about this - it is a deliberate choice to diagnose here given the function signature suggests it isn't an initialization function. Confirmed, but duplicated of PRxxx