autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix exit status of expr version of as_func_arith.


From: Eric Blake
Subject: Re: Fix exit status of expr version of as_func_arith.
Date: Sun, 16 Nov 2008 14:01:25 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 11/16/2008 12:53 PM:
> OK?  Posix rules are: zero exit status for nonzero result, 1 for zero
> result, other for other errors (such as invalid input).  The Autoconf
> manual lists that QNX expr may exit 1 instead of 0.  Other pitfalls
> we may have overlooked?

Looks okay to me.  Note, however, that bash doesn't change status to
non-zero on $(()) failure:

$ echo $((+))
bash: +: syntax error: operand expected (error token is "+")
$ echo $?
0

so we can't really make as_func_arith a reliable way to detect ill-formed
input.

>     * lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE): Count an exit
>     status of 1 of expr also as success, to avoid failure of the

s/of the/if the/

>     computation result is zero.  Fixes test failures with IRIX sh,
>     where the expr variant of as_func_arith is used.
> 

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkgiiUACgkQ84KuGfSFAYDMAwCeJIyZnSbJN9gJGBf2yMd3KLRj
AUIAnRXDhQP27EDw2YwQLnKkXiiDWUht
=VJS+
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]