autoconf-patches
[Top][All Lists]
Advanced

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

trailing space in config.h


From: Eric Blake
Subject: trailing space in config.h
Date: Tue, 12 Feb 2008 16:08:03 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I noticed that the gnulib flexmember module was resulting in trailing space in 
<config.h>, in spite of the fact that m4sugar intentionally squashes trailing 
space.  The culprit?  Upon seeing AC_DEFINE([FLEXIBLE_ARRAY_MEMBER],[]), the 
sed script portion of config.status blindly uses " \2" when generating the text 
for the awk script to output in a #define line, resulting in a trailing space 
when \2 is empty.  My solution?  Rather than hacking the output that creates 
the sed scripts, I taught AC_DEFINE that an empty argument should be shown as a 
comment instead (besides, this style is frequently used as a way to make it 
clear that a macro is intentionally defined to be empty).  I'm pushing this 
commit:

From: Eric Blake <address@hidden>
Date: Tue, 12 Feb 2008 08:49:59 -0700
Subject: [PATCH] Avoid trailing space in config.h with AC_DEFINE([var], []).

* lib/autoconf/general.m4 (_AC_DEFINE_Q): Explicitly mark empty
defines with a comment.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog               |    6 ++++++
 lib/autoconf/general.m4 |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4ee1cd4..8fe8873 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-12  Eric Blake  <address@hidden>
+
+       Avoid trailing space in config.h with AC_DEFINE([var], []).
+       * lib/autoconf/general.m4 (_AC_DEFINE_Q): Explicitly mark empty
+       defines with a comment.
+
 2008-02-08  Eric Blake  <address@hidden>
 
        Fix texinfo typos in previous patch.
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 92483db..645108e 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2056,7 +2056,7 @@ m4_cond([m4_index([$3], [
 m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])])dnl
 m4_popdef([AC_name])dnl
 cat >>confdefs.h <<$1_ACEOF
address@hidden:@define] $2 m4_if($#, 2, 1, [$3])
address@hidden:@define] $2 m4_if([$#], 2, 1, [$3], [], [/**/], [$3])
 _ACEOF
 ])
 
-- 
1.5.4







reply via email to

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