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 <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
---
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 <[EMAIL PROTECTED]>
+
+ 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 <[EMAIL PROTECTED]>
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
[EMAIL PROTECTED]:@define] $2 m4_if($#, 2, 1, [$3])
[EMAIL PROTECTED]:@define] $2 m4_if([$#], 2, 1, [$3], [], [/**/], [$3])
_ACEOF
])
--
1.5.4