[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint.mk: also prohibit "#undef" of always-defined symbols
From: |
Jim Meyering |
Subject: |
[PATCH] maint.mk: also prohibit "#undef" of always-defined symbols |
Date: |
Thu, 27 May 2010 13:35:05 +0200 |
I noticed some #undef uses that were made obsolete by gnulib use,
so tweaked this syntax-check rule to spot them, just like it does
for #define'd symbols:
>From 8b4add2c64d10b260c21352768e22d41dc9d2ff7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 27 May 2010 13:33:04 +0200
Subject: [PATCH] maint.mk: also prohibit "#undef" of always-defined symbols
* top/maint.mk (def_sym_regex): Handle #undef as well as #define.
Allow more than one space before the symbol name.
(sc_prohibit_always-defined_macros): Use grep's -E, now that
the regexp uses alternation.
---
ChangeLog | 8 ++++++++
top/maint.mk | 5 +++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1ee9575..6a54e63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-27 Jim Meyering <address@hidden>
+
+ maint.mk: also prohibit "#undef" of always-defined symbols
+ * top/maint.mk (def_sym_regex): Handle #undef as well as #define.
+ Allow more than one space before the symbol name.
+ (sc_prohibit_always-defined_macros): Use grep's -E, now that
+ the regexp uses alternation.
+
2010-05-26 Eric Blake <address@hidden>
maint.mk: avoid echo -e
diff --git a/top/maint.mk b/top/maint.mk
index 045537f..644fbb6 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -689,7 +689,8 @@ define def_sym_regex
perl -lne '$(gl_extract_significant_defines_)' $$f; \
done; \
) | sort -u \
- | sed 's/^/^ *# *define /;s/$$/\\>/'
+ | grep -Ev '^ATTRIBUTE_NORETURN' \
+ | sed 's/^/^ *# *(define|undef) */;s/$$/\\>/'
endef
# Don't define macros that we already get from gnulib header files.
@@ -698,7 +699,7 @@ sc_prohibit_always-defined_macros:
case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \
echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
esac; \
- $(def_sym_regex) | grep -f - $$($(VC_LIST_EXCEPT)) \
+ $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT)) \
&& { echo '$(ME): define the above via some gnulib .h file' \
1>&2; exit 1; } || :; \
fi
--
1.7.1.348.gb26ba
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] maint.mk: also prohibit "#undef" of always-defined symbols,
Jim Meyering <=