Eric Blake wrote:
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 agree; I wish it didn't, as the usage is benign on all real-world platforms other than those set up to debug "violations". It's reasonable to warn about memcpy (x, y, 0) when x or y is garbage, but not when x or y is null.

Reply via email to