On 02/05/2018 04:49 PM, aotto wrote:
You are correct that autoconf's detection of unexpanded macros is
unaware of comment syntax. Would you like to prepare a patch to the
post-processing pass that looks for unexpanded macros to first filter
out all comment lines?
Checking for unexpected names inside comments is different from checking
for intentional output embedded in error messages, where the code has to
work even without comments protecting the text.
the problem is not only the comment… today I had a "string" with
macroname inside in the file
acinclude.m4… and "aclocal --force -I m4" run "forever" and eat all my
memory… example:
AC_DEFUN([SC_ENABLE_DEBUG], [
AS_IF([test "x$config_site" = "xyes"], [
AC_MSG_NOTICE(["ENABLE_DEBUG: using 'config.site' defaults"])
…
if you switch ENABLE_DEBUG to SC_ENABLE_DEBUG… then you have a really
BIG problem… :-)
That's why the manual suggests that you use a quadrigraph for cases like
that, as in:
AC_MSG_NOTICE(["SC_@&t@ENABLE_DEBUG: ...."])
where the @&t@ quadrigraph expands to the empty string AFTER all
checking for unexpanded macros has taken place, and its presence in the
meantime is enough to prevent unintended infinite recursion of trying to
expand the SC_ENABLE_DEBUG macro from its own output.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org