On 05/31/2011 09:38 AM, wu liang wrote:
> Sir,
> In the chapter 5, there is example as:
> ----------------------------------
> define(`foo’, `This is macro `foo’.’)
> The ‘foo’ in the expansion text is not expanded, since it is a quoted
> string, and not a name.
> ----------------------------------
> However, according to my test, this will cause infinite loop of
> printing. I think that each 'foo' will be expanded and whether it is
> quoted only affects when it is expanded.

Thanks for the report.  However, I think the manual is correct as is,
given my simple test (not to mention that 'make check' runs all the
examples in the manual, and has not detected any problems with this
example):

$ m4 <<\EOF
> define(`foo',`This is macro `foo'.')
> foo
> EOF

This is macro foo.
$

Please show your particular test to back up your claim; most likely, the
bug is in your test setup and not in m4 or in the manual.  Did you
perhaps use changequote to some other quote characters before trying the
define?  Does using 'm4 -deaqt' give any more insight into the infinite
loop (warning, that can produce a lot of output on anything larger than
a trivial test)?

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to