]> 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 09:46:00 +0000 (11:46 +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 26590c9cc7b689285e88d239bd3319f2ba51e69e..4aa72e1c0606482b7651d7727f7d5395339bdf06 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 7180cf3c125834a267d57fbcd4a420def9d47c08..557f11c6d4897038c8c9292f0b6e2a82ed5810d2 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 8b4c10102e1e8f08e3197155fd71c0c228949952..f546c6ae804b96b523ac19774a4cde60a8d687a7 100644 (file)
@@ -1,4 +1,4 @@
-# aligned_alloc.m4 serial 5
+# aligned_alloc.m4 serial 6
 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],
 
   gl_CHECK_FUNCS_ANDROID([aligned_alloc], [[#include <stdlib.h>]])
   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],