|
From: | Paul Eggert |
Subject: | Re: [PATCH] dfa: port to gcc -fsanitize=undefined |
Date: | Mon, 16 Jan 2017 10:26:37 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |