[Bug libfortran/80365] undefined memcpy while writing zero length array on unformatted stream in unix.c
zeccav at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Jul 9 15:43:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80365
--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> ---
Or you may add
assert(buf);
just before the memcpy library call.
If nbyte==0 then it should be harmless, but undefined.
assert(buf || !nbyte) should catch an error situation
More information about the Gcc-bugs
mailing list