[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PING] Make AC_CHECK_SIZEOF warning-free
From: |
Paul Eggert |
Subject: |
Re: [PING] Make AC_CHECK_SIZEOF warning-free |
Date: |
09 Jan 2004 22:50:03 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Eric Blake <address@hidden> writes:
> Any word on whether this patch has even been looked at?
I just looked at it, and installed the much-more-complicated
patch enclosed below, as it should generate a somewhat smaller
script. Thanks for reporting the bug.
2004-01-09 Paul Eggert <address@hidden>
* lib/autoconf/general.m4: Fix bug: AC_CHECK_SIZEOF evokes a warning
with `autoconf -Wall,error'. Bug reported by Eric Blake in
<http://mail.gnu.org/archive/html/autoconf-patches/2004-01/msg00000.html>.
(_AC_COMPUTE_INT_COMPILE): Invoke _AC_COMPILE_IFELSE, not
AC_COMPILE_IFELSE, since we now assume our caller invokes
AC_LANG_COMPILER_REQUIRE, for symmetry with _AC_COMPUTE_INT_RUN.
(_AC_COMPUTE_INT_RUN): Likewise, for _AC_RUN_IFELSE instead
of AC_RUN_IFELSE; this avoids the warning mentioned above.
(_AC_COMPUTE_INT): Invoke AC_LANG_COMPILER_REQUIRE.
--- general.m4.~1.827.~ Wed Jan 7 15:46:43 2004
+++ general.m4 Fri Jan 9 22:34:21 2004
@@ -2467,10 +2467,10 @@ AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
# Works OK if cross compiling, but assumes twos-complement arithmetic.
m4_define([_AC_COMPUTE_INT_COMPILE],
[# Depending upon the size, compute the lo and hi bounds.
-AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
+_AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
[ac_lo=0 ac_mid=0
while :; do
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
+ _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
[ac_hi=$ac_mid; break],
[ac_lo=`expr $ac_mid + 1`
if test $ac_lo -le $ac_mid; then
@@ -2482,7 +2482,7 @@ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_
[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
[ac_hi=-1 ac_mid=-1
while :; do
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
+ _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
[ac_lo=$ac_mid; break],
[ac_hi=`expr '(' $ac_mid ')' - 1`
if test $ac_mid -le $ac_hi; then
@@ -2495,7 +2495,7 @@ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
+ _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
[ac_hi=$ac_mid], [ac_lo=`expr '(' $ac_mid ')' + 1`])
done
case $ac_lo in
@@ -2509,14 +2509,15 @@ esac[]dnl
# -----------------------------------------------------------------
# Store the evaluation of the integer EXPRESSION in VARIABLE.
m4_define([_AC_COMPUTE_INT_RUN],
-[AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
+[_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
[$2=`cat conftest.val`], [$4])])
# _AC_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)
# ---------------------------------------------------------
m4_define([_AC_COMPUTE_INT],
-[if test "$cross_compiling" = yes; then
+[AC_LANG_COMPILER_REQUIRE()dnl
+if test "$cross_compiling" = yes; then
_AC_COMPUTE_INT_COMPILE([$1], [$2], [$3], [$4])
else
_AC_COMPUTE_INT_RUN([$1], [$2], [$3], [$4])