bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: m4 brackets question


From: Bruno Haible
Subject: Re: m4 brackets question
Date: Tue, 13 Sep 2011 23:09:16 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Hi Eric,

> # is a comment character in m4, which reads until 
> end-of-line to end the comment.  Which means all the [] after the 
> comment character are treated as part of the comment, instead of as m4 
> [] quoting.

Thanks for explaining. Now I understand it.

What is called an "m4 comment" is thus actually a piece of quoted text.
And     # foo <newline>    is like   [ foo ]
except that in the latter case, one level of brackets is removed at each
processing, right? And these two ways of quoting interfere with each
other.

For m4, which was designed for preprocessing assembler source code, that
is a feature.

But for autoconf macros, that is a misfeature. It forces people to
use quadrigraphs instead of a literal #, or to add extra brackets around
the # character.

Please, can you turn off these "m4 comments" for Autoconf 3.0?

Now about the macros in gnulib. I guess this one is not problematic?
There are many #include statements like this.

  tanl.m4:54:    AC_CHECK_DECL([tanl], , [HAVE_DECL_TANL=0], [#include 
<math.h>])

Which of the following code lines should be changed, for maintainability?

  absolute-header.m4:87:      s#^/[^/]#//&#
  csharpcomp.m4:15:  AC_MSG_CHECKING([for C[#] compiler])
  csharpexec.m4:15:  AC_MSG_CHECKING([for C[#] program execution engine])
  csharp.m4:11:  AC_MSG_CHECKING([for preferred C[#] implementation])
  csharp.m4:13:    [  --enable-csharp[[=IMPL]]  choose preferred C[#] 
implementation (pnet or mono)],
  csharp.m4:21:        [Define if pnet is the preferred C# implementation.])
  csharp.m4:25:        [Define if mono is the preferred C# implementation.])
  include_next.m4:226:               
gl_absolute_header_sed='\#'"${gl_dirsep_regex}"']m4_defn([gl_HEADER_NAME])[#{
  include_next.m4:227:                   
s#.*"\(.*'"${gl_dirsep_regex}"']m4_defn([gl_HEADER_NAME])[\)".*#\1#
  include_next.m4:228:                   s#^/[^/]#//&#
  po.m4:122:          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e 
"/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e 
"\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"

Bruno
-- 
In memoriam Ketevan of Mukhrani 
<http://en.wikipedia.org/wiki/Ketevan_of_Mukhrani>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]