On 01/15/2017 08:09 PM, Paul Eggert wrote:
> * lib/dfa.c (copy): Don’t pass NULL with size 0 to memcpy,
> as this runs afoul of gcc -fsanitize=undefined.

It's lame that gcc warns on that usage; I'm half-tempted to propose a
POSIX bug that various memory functions (memcpy being one of them)
should sanely behave on a length of 0 regardless of the pointer argument
(that is, require that implementations not dereference the pointer when
length is 0).  But even if POSIX accepts such an improvement, we're
still stuck working around existing compilers/system headers that warn.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to