https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104854
David Malcolm <dmalcolm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmalcolm at gcc dot gnu.org --- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Compiler Explorer link for the above (with -fanalyzer -Wall -Wstringop-overread -O2; -O2 seems to be needed to trigger it): https://godbolt.org/z/jcEdxfEv9 In function 'foo', inlined from 'bar' at <source>:12:10: <source>:6:10: warning: '__builtin_strndup' specified bound 20 exceeds source size 5 [-Wstringop-overread] 6 | return __builtin_strndup ("test", size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~