This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Unconditionally define memcmp() if not sane
authorKarl Williamson <khw@cpan.org>
Sat, 10 Sep 2016 14:46:18 +0000 (08:46 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 17 Sep 2016 23:22:26 +0000 (17:22 -0600)
Prior to this commit, if there was a #define for memcmp that invoked a
version that Configure deemed to not be sufficient for normal use, it
was retained, so that perl used the defective version.  This apparently
hasn't been a problem in the field, but I realized the potential issue
doing code reading, and am correcting it.

perl.h

diff --git a/perl.h b/perl.h
index f1914a8..454304b 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1041,9 +1041,8 @@ EXTERN_C int usleep(unsigned int);
 #    endif
 #  endif
 #else
-#   ifndef memcmp
-#      define memcmp   my_memcmp
-#   endif
+#   undef memcmp
+#   define memcmp   my_memcmp
 #endif /* HAS_MEMCMP && HAS_SANE_MEMCMP */
 
 #ifndef memzero