Rainer Tammer wrote: > # ./testme > acos requires libm > asin requires libm > atan requires libm > atan2 requires libm > cbrt requires libm > copysign requires libm > cos requires libm > cosh requires libm > erf requires libm > erfc requires libm > exp requires libm > fmod requires libm > hypot requires libm > j0 requires libm > j1 requires libm > jn requires libm > lgamma requires libm > log requires libm > log10 requires libm > log1p requires libm > pow requires libm > remainder requires libm > sin requires libm > sinh requires libm > sqrt requires libm > tan requires libm > tanh requires libm > y0 requires libm > y1 requires libm > yn requires libm
Ah! This makes much more sense, now. So I conclude that the xlc compiler (or its linker) was optimizing away the 'funcptr' variable. This should fix it: 2010-07-31 Bruno Haible <br...@clisp.org> Correctly determine whether pow is available in libc on AIX 7 with xlc. * m4/mathfunc.m4 (gl_MATHFUNC): Actually use the 'funcptr' variable. This disables an xlc optimization that was causing wrong test results. Reported by Rainer Tammer. --- m4/mathfunc.m4.orig Sat Jul 31 13:58:20 2010 +++ m4/mathfunc.m4 Sat Jul 31 13:57:38 2010 @@ -1,4 +1,4 @@ -# mathfunc.m4 serial 5 +# mathfunc.m4 serial 6 dnl Copyright (C) 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -24,12 +24,15 @@ [gl_cv_func_]func[_no_libm], [ AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include <math.h> - $2 (*funcptr) $3 = ]func[;]], - [[return 0;]])], + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include <math.h> + $2 (*funcptr) $3 = ]func[;]], + [[$2 y = funcptr ]m4_bpatsubst([m4_bpatsubst([$3], [int], [2])], [double], [1.6180339887])[; + return y < 0.3 || y > 1.7; + ]])], [gl_cv_func_]func[_no_libm=yes], [gl_cv_func_]func[_no_libm=no]) ]) @@ -40,12 +43,15 @@ save_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include <math.h> - $2 (*funcptr) $3 = ]func[;]], - [[return 0;]])], + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include <math.h> + $2 (*funcptr) $3 = ]func[;]], + [[$2 y = funcptr ]m4_bpatsubst([m4_bpatsubst([$3], [int], [2])], [double], [1.6180339887])[; + return y < 0.3 || y > 1.7; + ]])], [gl_cv_func_]func[_in_libm=yes], [gl_cv_func_]func[_in_libm=no]) LIBS="$save_LIBS"