From: Bruno Haible Date: Fri, 18 Aug 2023 16:54:28 +0000 (+0200) Subject: aligned_alloc: Fix test failure on AIX 7.3 with ibm-clang. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=bae04c84b7ca3bb9403c116446d03dc16f9eee63;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 21d6ded942..8eba0282ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-08-18 Bruno Haible + + 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 sys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc. diff --git a/doc/posix-functions/aligned_alloc.texi b/doc/posix-functions/aligned_alloc.texi index e78ca16f9e..138142cefb 100644 --- a/doc/posix-functions/aligned_alloc.texi +++ b/doc/posix-functions/aligned_alloc.texi @@ -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: diff --git a/m4/aligned_alloc.m4 b/m4/aligned_alloc.m4 index 31681ac52a..4221524806 100644 --- a/m4/aligned_alloc.m4 +++ b/m4/aligned_alloc.m4 @@ -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 ]], - [[return aligned_alloc (2, 18) == NULL; + [[void *volatile p = aligned_alloc (2, 18); + return p == NULL; ]]) ], [gl_cv_func_aligned_alloc_works=yes],