autoconf
[Top][All Lists]
Advanced

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

Re: OS/2 and stdarg module


From: Eric Blake
Subject: Re: OS/2 and stdarg module
Date: Sat, 01 Jul 2006 20:42:50 +0000

Andreas B√ľning <andreas.buening <at> nexgo.de> writes:

> 
> Since $gl_cv_func___va_copy != yes the code after else is executed
> and "#define va_copy gl_va_copy" is inserted into config.h. Obviously,
> it is intended to also define gl_va_copy in this case but AH_VERBATIM
> is called with wrong syntax so that this statement has no effect. 
> 
> The autoconf manual says:
> ----------------------------
>  - Macro: AH_VERBATIM (KEY, TEMPLATE)
>      Tell `autoheader' to include the TEMPLATE as-is in the header
>      template file.  This TEMPLATE is associated with the KEY, which is
>      used to sort all the different templates and guarantee their
>      uniqueness.  It should be a symbol that can be `AC_DEFINE''d.

Thanks for catching that.  

> Unfortunately, also AH_VERBATIM([_MY_KEY], [#define gl_va_copy(a,b) (a) = 
> (b)])
> wouldn't work because (AFAIK) AH_VERBATIM is not expanded at run time (i.e.,
> by configure) but at "compile" time, i.e. by autoheader. This means

Yes, but the definition is for gl_va_copy.  If you have a working va_copy, it
does not matter if gl_va_copy is defined, unused, in config.h.  And if you have
a missing va_copy, it is the subsequent AC_DEFINE([va_copy], [gl_va_copy])
that activates the definition.

Meanwhile, is it worth patching autoconf/lib/autoheader.m4 to complain when
$2 of AH_VERBATIM is empty, so this mistake is less likely to occur in the
future?

I'm installing this into gnulib:

2006-07-01  Eric Blake  <address@hidden>

        * stdarg.m4 (gl_STDARG_H): Use proper AH_VERBATIM.
        Reported by Andreas Buening.

Index: m4/stdarg.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/stdarg.m4,v
retrieving revision 1.1
diff -u -p -r1.1 stdarg.m4
--- m4/stdarg.m4        8 May 2006 13:13:13 -0000       1.1
+++ m4/stdarg.m4        1 Jul 2006 20:41:16 -0000
@@ -31,7 +31,8 @@ error, bail out
       AC_DEFINE([va_copy], [__va_copy],
         [Define as a macro for copying va_list variables.])
     else
-      AH_VERBATIM([#define gl_va_copy(a,b) (a) = (b)])
+      AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed.  */
+#define gl_va_copy(a,b) (a) = (b)])
       AC_DEFINE([va_copy], [gl_va_copy],
         [Define as a macro for copying va_list variables.])
     fi

reply via email to

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