This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
memset zero bytes at NULL - isolate-erroneous-paths
- From: Dominic News <d dot newsgroups at googlemail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 17 Nov 2013 19:25:14 +0100
- Subject: memset zero bytes at NULL - isolate-erroneous-paths
- Authentication-results: sourceware.org; auth=none
In the following code (from xorg-server)
if (a == 0)
addr = 0;
(...)
memset(addr, '\0', a);
the path for a==0 is turned into a trap by -fisolate-erroneous-paths. (Is
calling memset like this undefined behaviour?)
Is it intentional that essentially a noop is turned into a trap?
Dominic