From MAILER-DAEMON Thu Jun 04 17:59:53 2015
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Z0dB2-0002iB-Vn
	for mharc-autoconf-commit@gnu.org; Thu, 04 Jun 2015 17:59:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39094)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Z0dAz-0002hr-Sp
	for autoconf-commit@gnu.org; Thu, 04 Jun 2015 17:59:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Z0dAy-00004u-KX
	for autoconf-commit@gnu.org; Thu, 04 Jun 2015 17:59:49 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:57181)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Z0dAy-0008WI-H5
	for autoconf-commit@gnu.org; Thu, 04 Jun 2015 17:59:48 -0400
Received: from ericb by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Z0dAx-0005LN-FN
	for autoconf-commit@gnu.org; Thu, 04 Jun 2015 21:59:47 +0000
Date: Thu, 04 Jun 2015 21:59:47 +0000
Message-Id: <E1Z0dAx-0005LN-FN@vcs.savannah.gnu.org>
From: "Eric Blake" <eblake@redhat.com>
To: autoconf-commit@gnu.org
Subject: [SCM] GNU Autoconf source repository branch, master,
	updated. v2.69-144-g51b89d1
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 82ef7805faffa151e724aa76c245ec590d174580
X-Git-Newrev: 51b89d1ccd9b3e4d7d89acc0390f8a297184ad96
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: autoconf-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: autoconf-patches@gnu.org
List-Id: Commits to the Autoconf git repository <autoconf-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf-commit>
List-Post: <mailto:autoconf-commit@gnu.org>
List-Help: <mailto:autoconf-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Jun 2015 21:59:51 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=51b89d1ccd9b3e4d7d89acc0390f8a297184ad96

The branch, master has been updated
       via  51b89d1ccd9b3e4d7d89acc0390f8a297184ad96 (commit)
      from  82ef7805faffa151e724aa76c245ec590d174580 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 51b89d1ccd9b3e4d7d89acc0390f8a297184ad96
Author: Eric Blake <eblake@redhat.com>
Date:   Thu Jun 4 14:00:29 2015 -0600

    doc: mention 'for' syntax issue on older shells
    
    Based on a report by Michael Felt, via Paul Eggert on the
    coreutils list.
    
    * doc/autoconf.texi (Limitations of Builtins) <for>: Document
    problem with 'for var in ;'.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 doc/autoconf.texi |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 8c4302d..9eac07b 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -17757,6 +17757,42 @@ But keep in mind that Zsh, even in Bourne shell emulation mode, performs
 word splitting on @samp{$@{1+"$@@"@}}; see @ref{Shell Substitutions},
 item @samp{$@@}, for more.
 
+Posix requires support for a @command{for} loop with no list after
+@code{in}.  However, Solaris @command{/bin/sh} treats that as a syntax
+error.  It is possible to work around this by providing any shell word
+that expands to nothing, or by ignoring an obvious sentinel.
+
+@example
+$ @kbd{/bin/sh -c 'for a in $empty; do echo hi; done'}
+$ @kbd{/bin/sh -c 'for a in ; do echo hi; done'}
+/bin/sh: syntax error at line 1: `;' unexpected
+@end example
+
+This syntax problem is most frequently encountered in code that goes
+through several layers of expansion, such as an m4 macro or makefile
+variable used as a list body, where the first layer of expansion (m4 or
+make) can end up expanding to nothing in the version handed to the
+shell.  In the makefile context, one common workaround is to use a shell
+variable rather than a make variable as the source of the list.
+
+@example
+$ @kbd{cat Makefile}
+list =
+bad:
+	@@for arg in $(list); do echo $$arg; done
+good:
+	@@list='$(list)'; for arg in $$list; do echo $$arg; done
+$ @kbd{make bad 2&>1 | head -n1}
+sh: syntax error at line 1: `;' unexpected
+$ @kbd{make bad list='a b'}
+a
+b
+$ @kbd{make good}
+$ @kbd{make good list='a b'}
+a
+b
+@end example
+
 In Solaris @command{/bin/sh}, when the list of arguments of a
 @command{for} loop starts with @emph{unquoted} tokens looking like
 variable assignments, the loop is not executed on those tokens:


hooks/post-receive
-- 
GNU Autoconf source repository


