]> Savannah Git Hosting - gnulib.git/commitdiff
aligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.
authorBruno Haible <bruno@clisp.org>
Fri, 18 Aug 2023 16:54:28 +0000 (18:54 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 30 Aug 2023 10:12:08 +0000 (12:12 +0200)
* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use 'volatile', to
disable optimization of ibm-clang -O2.
* doc/posix-functions/aligned_alloc.texi: Update version info.

ChangeLog
doc/posix-functions/aligned_alloc.texi
m4/aligned_alloc.m4

index 21d6ded9421e204769523adb6693dd0f5baf36cd..8eba0282caf74720e107b7b9fd5f1f38833dcf52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-18  Bruno Haible  <bruno@clisp.org>
+
+       aligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.
+       * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use 'volatile', to
+       disable optimization of ibm-clang -O2.
+       * doc/posix-functions/aligned_alloc.texi: Update version info.
+
 2023-08-18  Bruno Haible  <bruno@clisp.org>
 
        sys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc.
index e78ca16f9ed5d7fdb28cf06ea90a27eb98a5451c..138142cefb92f352ae07cc555e1a1cbb6c4e26d4 100644 (file)
@@ -11,7 +11,7 @@ Portability problems fixed by Gnulib:
 @item
 This function fails if the alignment argument is smaller than
 @code{sizeof (void *)} on some platforms:
-macOS 11.1, AIX 7.2.
+macOS 11.1, AIX 7.3.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 31681ac52a29f4a0342a0854ad051b7b7f3ec47b..42215248062cc572cb4e341f0c002700f4576a93 100644 (file)
@@ -1,4 +1,4 @@
-# aligned_alloc.m4 serial 3
+# aligned_alloc.m4 serial 3.1
 dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,15 +14,16 @@ AC_DEFUN([gl_FUNC_ALIGNED_ALLOC],
 
   AC_CHECK_FUNCS_ONCE([aligned_alloc])
   if test $ac_cv_func_aligned_alloc = yes; then
-    dnl On macOS 11.1 and AIX 7.2, aligned_alloc returns NULL when the alignment
-    dnl argument is smaller than sizeof (void *).
+    dnl On macOS 11.1 and AIX 7.3.1, aligned_alloc returns NULL when the
+    dnl alignment argument is smaller than sizeof (void *).
     AC_CACHE_CHECK([whether aligned_alloc works for small alignments],
       [gl_cv_func_aligned_alloc_works],
       [AC_RUN_IFELSE(
          [AC_LANG_PROGRAM(
             [[#include <stdlib.h>
             ]],
-            [[return aligned_alloc (2, 18) == NULL;
+            [[void *volatile p = aligned_alloc (2, 18);
+              return p == NULL;
             ]])
          ],
          [gl_cv_func_aligned_alloc_works=yes],