[Bug tree-optimization/96951] strncpy truncation warning does not recognize truncation check
fw at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 7 10:10:46 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96951
--- Comment #2 from Florian Weimer <fw at gcc dot gnu.org> ---
Then the warning should recommend to use memccpy, perhaps?
if (memccpy (p->string, s, '\0', sizeof (p->string)) == NULL)
return -1;
return 0;
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Gcc-bugs
mailing list