bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] maint.mk: catch more abuse of HAVE_DECL in syntax-check


From: Eric Blake
Subject: [PATCH] maint.mk: catch more abuse of HAVE_DECL in syntax-check
Date: Fri, 10 May 2013 20:33:30 -0600

Libvirt had a patch that attempted to do:

+#elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \
+    defined(HAVE_DECL_LINK_ADDR)

but which was not flagged by the syntax checker as suspicious
(all HAVE_DECL_* symbols defined by autoconf are always defined
after including <config.h>, although they are sometimes defined
as the value 0).  Now that code is flagged until changed to:

+#elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \
+    HAVE_DECL_LINK_ADDR

* top/maint.mk (sc_prohibit_defined_have_decl_tests): Relax regex.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    | 5 +++++
 top/maint.mk | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2e8f618..4d266fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-10  Eric Blake  <address@hidden>
+
+       maint.mk: catch more abuse of HAVE_DECL in syntax-check
+       * top/maint.mk (sc_prohibit_defined_have_decl_tests): Relax regex.
+
 2013-05-08  Eric Blake  <address@hidden>

        bootstrap: AC_INIT may have more than four parameters
diff --git a/top/maint.mk b/top/maint.mk
index 2b454a1..c1b786f 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -809,7 +809,7 @@ sc_prohibit_always_true_header_tests:
          $(_sc_search_regexp)

 sc_prohibit_defined_have_decl_tests:
-       @prohibit='#[    ]*if(n?def|.*\<defined)\>[      (]+HAVE_DECL_' \
+       @prohibit='(#[   ]*ifn?def|\<defined)\>[         (]+HAVE_DECL_' \
        halt='HAVE_DECL macros are always defined'                      \
          $(_sc_search_regexp)

-- 
1.8.1.4




reply via email to

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