Hi Stepan, * Stepan Kasal wrote on Tue, Oct 25, 2005 at 01:16:06PM CEST: > On Sat, Sep 10, 2005 at 04:17:52PM +0100, Gary V. Vaughan wrote: > > :-( Can you document in HACKING that because of our use of AU_ALIAS to > > maintain backwards compatibility with earlier libtool interfaces we must > > not use $# in m4. > > actually, I'd prefer if you could put it this way: *snip*
Can the Autoconf manual also please _explicitly_ *warn* against using `$#' at all in macros? > [ put in public domain, in case you want to paste it somewhere ;-) ] FYI, public domain is not the same thing as copyright assignment; disclaimer is ok, though. Also FYI: I have applied the patch below to Libtool CVS HEAD. Cheers, Ralf 2005-10-27 Stepan Kasal <[EMAIL PROTECTED]> * HACKING: Update note about use of `$#' in m4 macros. Index: HACKING =================================================================== RCS file: /cvsroot/libtool/libtool/HACKING,v retrieving revision 1.21 diff -u -r1.21 HACKING --- HACKING 26 Sep 2005 12:21:53 -0000 1.21 +++ HACKING 27 Oct 2005 13:23:13 -0000 @@ -241,8 +241,11 @@ $ECHO ".." for strings without leading hyphen, $ECHO "X.." | $Xsed otherwise. -* Do not use the number of macro arguments `$#' in public macros; - AU_ALIAS may change it. +* The Autoconf manual says that giving an empty parameter is equivalent + to not giving it at all. (In particular, the Autoconf manual doesn't + explain that "FOO()" is calling macro FOO with one empty parameter.) + To prevent misunderstanding, we should use m4_ifval to check whether + a parameter is empty, and not $# to check for the number of parameters. 9. Abstraction layers in libltdl