[PATCH] Fix an infinitely recursing example

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix an infinitely recursing example

Quinn Grier
The "single" macro infinitely recurses because its expansion contains
the unquoted text " single-". The "double" macro almost has the same
problem, but it is protected by extra quotes. In any case, the macro
names being repeated in the macro definitions is not necessary.

This commit changes the macro names to "foo" and "bar", which are taken
from a very similar example in the GNU M4 1.4.17 manual. See lines 1971
to 1980 of v1.4.17:doc/m4.texi in the GNU M4 Git repository.
---
 doc/autoconf.texi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 4be1f70..9b7468b 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -10573,13 +10573,13 @@ quoting; if the usage is already inside a double-quoted string, then
 split it into concatenated strings.
 
 @example
-define([single], [a single-quoted $[]1 definition])
+define([foo], [a single-quoted $[]1 definition])
 @result{}
-define([double], [[a double-quoted $][1 definition]])
+define([bar], [[a double-quoted $][1 definition]])
 @result{}
-single
+foo
 @result{}a single-quoted $1 definition
-double
+bar
 @result{}a double-quoted $1 definition
 @end example
 
--
2.8.3


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix an infinitely recursing example

Eric Blake-3
On 11/02/2016 12:58 AM, Quinn Grier wrote:

> The "single" macro infinitely recurses because its expansion contains
> the unquoted text " single-". The "double" macro almost has the same
> problem, but it is protected by extra quotes. In any case, the macro
> names being repeated in the macro definitions is not necessary.
>
> This commit changes the macro names to "foo" and "bar", which are taken
> from a very similar example in the GNU M4 1.4.17 manual. See lines 1971
> to 1980 of v1.4.17:doc/m4.texi in the GNU M4 Git repository.
> ---
>  doc/autoconf.texi | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
Good catch!  I'll install this alongside other patches that I'm testing
this week.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


signature.asc (617 bytes) Download Attachment