]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
doc: update quoting example
authorEric Blake <eblake@redhat.com>
Tue, 14 Jun 2011 13:45:29 +0000 (07:45 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 14 Jun 2011 13:45:29 +0000 (07:45 -0600)
The existing example triggers an autoconf warning, due to the
change in AC_COMPILE_IFELSE probing for an AC_LANG_SOURCE use.

* doc/autoconf.texi (Autoconf Language): Add AC_LANG_SOURCE use.
* THANKS: Update.
Reported by Křištof Želechovski.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
THANKS
doc/autoconf.texi

index 1fca7bbf2b46e40809328cd5f3c33681f7d2aa50..03541e04a39c963a361dc1d080215fb1c3a93a4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-14  Eric Blake  <eblake@redhat.com>
+
+       doc: update quoting example
+       * doc/autoconf.texi (Autoconf Language): Add AC_LANG_SOURCE use.
+       * THANKS: Update.
+       Reported by Křištof Želechovski.
+
 2011-05-05  Eric Blake  <eblake@redhat.com>
 
        doc: document dash bug with positional parameters
diff --git a/THANKS b/THANKS
index 7679b054f9b4fc6509152d7ff559075fd60563a2..e125ebe49a5a187de585ddab0ab53c81f244445f 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -235,6 +235,7 @@ Kevin Ryde                  user42@zip.com.au
 Klee Dienes                 kdienes@apple.com
 Koji Arai                   JCA02266@nifty.ne.jp
 Kristian Kvilekval          kris@cs.ucsb.edu
+Křištof Želechovski         giecrilj@stegny.2a.pl
 Kurt D. Zeilenga            kurt@openldap.org
 Larry Jones                 larry.jones@sdrc.com
 Larry Schmitt               larry@mail.haleakalawebdesigns.com
index 7ff693f5d00d45f7c382063bd4150881ea61a361..99b1fd1f4e2ed78fde3d84fbe5375f7367c9f906 100644 (file)
@@ -1288,19 +1288,26 @@ has been continually misunderstood@enddots{}  The rule of thumb is that
 i.e., expect one level of quotes to be lost.  For instance:
 
 @example
-AC_COMPILE_IFELSE([char b[10];], [], [AC_MSG_ERROR([you lose])])
+AC_COMPILE_IFELSE(AC_LANG_SOURCE([char b[10];]), [],
+ [AC_MSG_ERROR([you lose])])
 @end example
 
 @noindent
-is incorrect: here, the first argument of @code{AC_COMPILE_IFELSE} is
+is incorrect: here, the first argument of @code{AC_LANG_SOURCE} is
 @samp{char b[10];} and is expanded once, which results in
-@samp{char b10;}.  (There was an idiom common in Autoconf's past to
+@samp{char b10;}; and the @code{AC_LANG_SOURCE} is also expanded prior
+to being passed to @code{AC_COMPILE_IFELSE}.  (There was an idiom common
+in Autoconf's past to
 address this issue via the M4 @code{changequote} primitive, but do not
 use it!)  Let's take a closer look: the author meant the first argument
-to be understood as a literal, and therefore it must be quoted twice:
+to be understood as a literal, and therefore it must be quoted twice;
+likewise, the intermediate @code{AC_LANG_SOURCE} macro should be quoted
+once so that it is only expanded after the rest of the body of
+@code{AC_COMPILE_IFELSE} is in place:
 
 @example
-AC_COMPILE_IFELSE([[char b[10];]], [], [AC_MSG_ERROR([you lose])])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char b[10];]])], [],
+  [AC_MSG_ERROR([you lose])])
 @end example
 
 @noindent