This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't look for a "safe" memcpy()
authorAaron Crane <arc@cpan.org>
Thu, 12 Oct 2017 11:47:22 +0000 (13:47 +0200)
committerAaron Crane <arc@cpan.org>
Sat, 21 Oct 2017 15:51:21 +0000 (16:51 +0100)
commit1c1d7d5ba0bc33e7bea0a9aeb2d420fc5a8128ab
tree74492a42f48126a77646de9420baebc6c28041bf
parent04322328fc4bc2863d0bc74339ed92d33b7eaba7
Don't look for a "safe" memcpy()

C89 says that, if you want to copy overlapping memory blocks, you must use
memmove(), and that attempt to copy overlapping memory blocks using memcpy()
yields undefined behaviour. So we should never even attempt to probe for a
system memcpy() implementation that just happens to handle overlapping
memory blocks. In particular, the compiler might compile the probe program
in such a way that Configure thinks overlapping memcpy() works even when it
doesn't.

This has the additional advantage of removing a Configure probe that needs
to execute a target-platform program on the build host.
28 files changed:
Configure
Cross/config.sh-arm-linux
Cross/config.sh-arm-linux-n770
NetWare/config.wc
NetWare/config_H.wc
Porting/Glossary
Porting/config.sh
Porting/config_H
config_h.SH
configure.com
embed.fnc
embed.h
perl.h
plan9/config.plan9
plan9/config_h.sample
plan9/config_sh.sample
proto.h
symbian/config.sh
uconfig.h
uconfig.sh
uconfig64.sh
util.c
win32/config.ce
win32/config.gc
win32/config.vc
win32/config_H.ce
win32/config_H.gc
win32/config_H.vc