[PATCH] cleanup: make memcpy check -Werror safe

Simon Richter <[email protected]>
Newsgroups gmane.linux.debian.devel.dpkg.general
Message-ID <[email protected]>
---
 configure.ac | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b084ade12..1daf4b1de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,7 +207,21 @@ DPKG_CHECK_COMPAT_FUNCS([\
   alphasort \
   unsetenv \
 ])
-AC_CHECK_FUNCS([memcpy lchown],
+
+AC_MSG_CHECKING([for memcpy])
+AC_LINK_IFELSE(
+  AC_LANG_PROGRAM(
+    [[
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+    ]],
+    [[memcpy(NULL, NULL, 0);]]),
+  [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([no])
+   AC_MSG_ERROR([missing required function])])
+
+AC_CHECK_FUNCS([lchown],
   [], [AC_MSG_ERROR([missing required function])])
 AC_CHECK_FUNCS([\
   strtoimax \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.