]> Savannah Git Hosting - gnulib.git/commitdiff
memmem: Avoid wrong configure results with "clang -fsanitize=undefined".
authorBruno Haible <bruno@clisp.org>
Thu, 21 May 2020 18:38:39 +0000 (20:38 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 21 May 2020 18:38:39 +0000 (20:38 +0200)
Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.

* m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): Use NULL + 1, not NULL.

ChangeLog
m4/memmem.m4

index 1e654f4313cafbf8161de0cb62dc0f518bed5419..c4d39646b15a2f85cd1b7add3009cba55b76c7ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-21  Bruno Haible  <bruno@clisp.org>
+
+       memmem: Avoid wrong configure results with "clang -fsanitize=undefined".
+       Reported by Tim Rühsen in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.
+       * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): Use NULL + 1, not NULL.
+
 2020-05-21  Bruno Haible  <bruno@clisp.org>
 
        regex: Avoid wrong configure results with "clang -fsanitize=leak".
index e034d7bd77585a99d75c1cd3fec8d829a4617448..35a5bb19d1a7206be2706d4a50d5249ac383a36e 100644 (file)
@@ -1,4 +1,4 @@
-# memmem.m4 serial 26
+# memmem.m4 serial 27
 dnl Copyright (C) 2002-2004, 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
     /* Check for empty needle behavior.  */
     {
       const char *haystack = "AAA";
-      if (memmem (haystack, 3, NULL, 0) != haystack)
+      if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
         result |= 2;
     }
     return result;