mirror of
git://git.sv.gnu.org/autoconf
synced 2024-12-03 02:00:36 +08:00
(_AC_COMPUTE_INT_COMPILE): Do not pass a first argument with leading '-'
to expr, by parenthesizing initial integers that might be negative.
This commit is contained in:
parent
69af46fdbd
commit
99ba592715
@ -2517,13 +2517,13 @@ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
|
||||
while :; do
|
||||
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
|
||||
[ac_lo=$ac_mid; break],
|
||||
[ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`])
|
||||
[ac_hi=`expr '(' $ac_mid ')' - 1`; ac_mid=`expr 2 '*' $ac_mid`])
|
||||
done])
|
||||
# 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_hi=$ac_mid], [ac_lo=`expr $ac_mid + 1`])
|
||||
[ac_hi=$ac_mid], [ac_lo=`expr '(' $ac_mid ')' + 1`])
|
||||
done
|
||||
$2=$ac_lo[]dnl
|
||||
])# _AC_COMPUTE_INT_COMPILE
|
||||
|
Loading…
Reference in New Issue
Block a user