https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90905
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2020-01-28 00:00:00 |2024-4-7 --- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note changing: ``` const char *p = "def"; ``` To: ``` static const char *p = "def"; ``` we do warn though. But increasing the size like: ``` static const char *p = "def123123123123123123123123123123"; ``` We don't warn. With the larger size we get: ``` operator delete (_8, _12); <bb 4> [local count: 1073741824]: str ={v} {CLOBBER(eob)}; str ={v} {CLOBBER(eos)}; return _8; ``` Which is not exactly a `-Wreturn-local-addr` warning but rather a `-Wuse-after-free` warning.