[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] cleanup: make memcpy check -Werror safe



---
 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 \
-- 
2.39.2


Reply to: