|
From: | Paul Eggert |
Subject: | Re: [PATCH] dfa: port to gcc -fsanitize=undefined |
Date: | Mon, 16 Jan 2017 15:15:04 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
Eric Blake wrote:
POSIX is allowed to make guarantees where the C standard left things unspecified, particularly if those guarantees are already something that many coders are already relying on because they don't know any better.
Yes, Gnulib code makes several such assumptions, documented in the Gnulib manual. See:
https://www.gnu.org/software/gnulib/manual/html_node/Portability-guidelines.htmlFor example, Gnulib code assumes that adding zero to a null pointer results in a null pointer. Luckily for us, -fsanitize=undefined doesn't try to catch these other violations of the standard, something that would waste even more of everybody's time.
Perhaps we should add memcpy (0, 0, 0) to that section of the Gnulib manual, if only to document our irritation at -fsanitize=undefined crying wolf here.
[Prev in Thread] | Current Thread | [Next in Thread] |