]> git.ipfire.org Git - thirdparty/autoconf.git/commit
autoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED
authorPaolo Bonzini <bonzini@gnu.org>
Mon, 31 Oct 2016 17:08:08 +0000 (18:08 +0100)
committerEric Blake <eblake@redhat.com>
Fri, 4 Nov 2016 21:12:52 +0000 (16:12 -0500)
commit527f183f232e14ebf0ef2b8a086d675e78700af2
treec7c507a892a9490255f02608af598d49ae0a1aad
parentb2621a91d70e5c86f4fbdce25eeb0f83df6645b6
autoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED

It is a very common case that a quadrigraph appears in the argument of
_AC_DEFINE_UNQUOTED, because "#define" is expanded through a quadrigraph.
Therefore, restrict the quadrigraph tests to "$" (for "$(" and "${")
and "(" (for "$(").

At the same time, "#" should not be used inside AC_ECHO because it confuses
m4's comment parsing.  This pre-existing latent bug is caught by test 251:

   AC_DEFINE_UNQUOTED([bar], [[%!_!# X]])

Previously the quadrigraph in "@%:@define bar %!_!# X" made Autoconf fall back
to cat anyway.  Now that Autoconf is not fooled by the quadrigraph, the test
catches that "#" is not special-cased.  Kudos to Eric for coming up with it!

* lib/autoconf/general (_AC_DEFINE_UNQUOTED): Do not blindly
use cat on all quadrigraphs.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Message-Id: <1477933688-4884-4-git-send-email-bonzini@gnu.org>
lib/autoconf/general.m4