Prevent mpatrol from issuing a diagnostic for memmove()
and memcpy() with a third argument of zero, even if that
would mean moving zero bytes between blocks of memory
that were previously free()d. Diagnostics like the
following
do not indicate real problems, because the attempted
operation would do nothing.
MEMCOPY: memmove (0x00FEEEE0, 0x00FEEED8, 0 bytes,
0x00) [-|-|-]
0x0040131A _main+106
0x00401182 ___mingw_CRTStartup+258
0x00401018 __RUNTIME_PSEUDO_RELOC_LIST_END__+24
0x77E97D08 CreateProcessW+3496
ERROR: [FREOPN]: memmove: attempt to perform operation
on free memory
A test case is given here:
http://groups.yahoo.com/group/mpatrol/message/796
Even though the C standard says this is undefined behavior,
such cases have been observed in real-world libraries,
including one C++ compiler's STL implementation. Example:
Patch to prevent diagnostics with zero-byte memory moves