bug-gnulib
[Top][All Lists]
Advanced

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

Re: warning: module to simplify adding compiler warnings


From: Paolo Bonzini
Subject: Re: warning: module to simplify adding compiler warnings
Date: Tue, 11 Nov 2008 13:52:35 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Bruno Haible wrote:
> Paolo Bonzini wrote:
>> @@ -47,4 +47,5 @@
>>  gl_AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
>>  AS_VAR_POPDEF([gl_Flags])dnl
>>  AS_VAR_POPDEF([gl_Warn])dnl
>> +AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])dnl
> 
> AS_LITERAL_IF is not documented in autoconf 2.63. Is there a documented
> replacement?

No, but it has been forever in M4sh.  I'll prepare a documentation patch.

> Also, if only one argument is given, won't this do an AC_SUBST([]) ?

Yes.  And I thought it was a no-op (that's why I AC_SUBSTed WARN_CFLAGS
separately), but it gives an error.

diff --git a/m4/warnings.m4 b/m4/warnings.m4
index ca9bf5e..71a8e56 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -47,5 +47,5 @@
 gl_AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
 AS_VAR_POPDEF([gl_Flags])dnl
 AS_VAR_POPDEF([gl_Warn])dnl
-AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])dnl
+m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
 ])

Paolo




reply via email to

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