]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Improve documentation about if exit status.
authorEric Blake <ebb9@byu.net>
Fri, 10 Apr 2009 04:33:37 +0000 (22:33 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 13 Apr 2009 19:15:39 +0000 (13:15 -0600)
* doc/autoconf.texi (Limitations of Builtins) <if>: Mention that
exit status bugs don't affect modern targets.
Reported by Andreas Schwab.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/autoconf.texi

index efa5501e9edbf62243bf1fac235832a6323380ee..2ad6ee7efef66fb4babf2a9d92407572307cd79a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-04-13  Eric Blake  <ebb9@byu.net>
 
+       Improve documentation about if exit status.
+       * doc/autoconf.texi (Limitations of Builtins) <if>: Mention that
+       exit status bugs don't affect modern targets.
+       Reported by Andreas Schwab.
+
        Add cross-reference to new macros.
        * doc/autoconf.texi (Text processing Macros) <m4_normalize>
        <m4_strip>: Reference the new m4_ifblank.
index 35cf745ac38b4fb58081df6e066981719e8c0a26..9e341d963917e583bb56f72967c722b277b9dc09 100644 (file)
@@ -15836,7 +15836,8 @@ AS_IF([cmp -s file file.new], [], [mv file.new file])
 This is especially useful in other M4 macros, where the @dfn{then} and
 @dfn{else} branches might be macro arguments.
 
-There are shells that do not reset the exit status from an @command{if}:
+Some very old shells did not reset the exit status from an @command{if}
+with no @command{else}:
 
 @example
 $ @kbd{if (exit 42); then true; fi; echo $?}
@@ -15844,9 +15845,10 @@ $ @kbd{if (exit 42); then true; fi; echo $?}
 @end example
 
 @noindent
-whereas a proper shell should have printed @samp{0}.  This is especially
-bad in makefiles since it produces false failures.  This is why properly
-written makefiles, such as Automake's, have such hairy constructs:
+whereas a proper shell should have printed @samp{0}.  But this is no
+longer a portability problem; any shell that supports functions gets it
+correct.  However, it explains why some makefiles have lengthy
+constructs:
 
 @example
 if test -f "$file"; then