AS_IF optimization (was: AC_TRY_COMPILE() annoyances with 2.63b)

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

 



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

According to Andreas Schwab on 4/7/2009 3:47 AM:
>>From the autoconf manual:
> 
>      There are shells that do not reset the exit status from an `if':
> 
>           $ if (exit 42); then true; fi; echo $?
>           42
> 
>      whereas a proper shell should have printed `0'.

Which shells?  Solaris /bin/sh passed this test (to my surprise, since if
fails the similar test for 'case `false` in *);; esac').  Even cygwin's
super-old ash passed this, although it falls flat on a number of other
constructs.  Could this be a case of urban legend?

To further reinforce my point, the autoconf testsuite currently has a test
of 'AS_IF([false]) && ...', but AS_IF currently omits the unused else
branch for that construct.  So if there really is such a shell that
botches the status after an omitted else, then it should trigger a
testsuite failure in at least 2.63b.

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

Eric Blake             ebb9@xxxxxxx
-----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

iEYEARECAAYFAknbQqUACgkQ84KuGfSFAYDbDACfQ8FNFjH3r82XtckHyLxFFRhw
i9sAoLUg7oNwFCgY3CITtiaAjzisf2vn
=/K+9
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux