]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
document shell function portability
authorPaolo Bonzini <bonzini@gnu.org>
Sat, 6 Oct 2007 09:25:49 +0000 (11:25 +0200)
committerPaolo Bonzini <bonzini@gnu.org>
Sat, 6 Oct 2007 09:26:20 +0000 (11:26 +0200)
2007-10-06  Paolo Bonzini  <bonzini@gnu.org>

        * doc/autoconf.texi (Shell portability): Document shell function
        portability.

Signed-Off-By: Paolo Bonzini <bonzini@gnu.org>
ChangeLog
doc/autoconf.texi

index 96a73aea48b62fa7bb64cf4efde9e3fec9b0ce25..159ba5b24eeca67a0eff09b4ba46bd81d46fc1e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-06  Paolo Bonzini  <bonzini@gnu.org>
+
+        * doc/autoconf.texi (Shell portability): Document shell function
+        portability.
+
 2007-10-06  Paolo Bonzini  <bonzini@gnu.org>
 
        * lib/autotest/general.m4 (AT_INIT): Add at_func_diff_devnull,
index 1d097f2b44f3b4abb8bf0c5d6bcce0e786ad41a2..423a8830427d94deeca28092a244156acec95aad 100644 (file)
@@ -11412,10 +11412,20 @@ have evolved over the years, but to prevent trouble, do not take
 advantage of features that were added after Unix version 7, circa
 1977 (@pxref{Systemology}).
 
-You should not use shell functions, aliases, negated character
-classes, or other features that are not found in all Bourne-compatible
-shells; restrict yourself to the lowest common denominator.  Even
-@code{unset} is not supported by all shells!
+You should not use aliases, negated character classes, or other features
+that are not found in all Bourne-compatible shells; restrict yourself
+to the lowest common denominator.  Even @code{unset} is not supported
+by all shells!
+
+Shell functions are considered portable nowadays, though Autoconf
+still does not use them (Autotest does).  However, inside a shell
+function you should not be using @code{$?} to check the return code
+of a subshell invocation; in general, since the caller of a shell
+function might look at the function's return code, make sure that the
+last statement of a shell function does not invoke a subshell.
+Using subshells triggers bugs in zsh 4.x; while Autoconf tries
+to find a shell that does not exhibit the bug, zsh might be the
+only shell present on the user's machine.
 
 Some ancient systems have quite
 small limits on the length of the @samp{#!} line; for instance, 32