summaryrefslogtreecommitdiff
path: root/Makefile.maint
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-08-23 16:52:09 +0000
committerJim Meyering <jim@meyering.net>2005-08-23 16:52:09 +0000
commita60996e13c58cf2389ce31ed92ace6dd591ea32a (patch)
tree449385e4aa381a195550af27a486f6eda7216582 /Makefile.maint
parentfce7aff711443c26d2a087a6d0fb1c5e8d5eb171 (diff)
downloadcoreutils-a60996e13c58cf2389ce31ed92ace6dd591ea32a.tar.xz
(sc_useless_cpp_parens): New rule.
(syntax-check-rules): Add it.
Diffstat (limited to 'Makefile.maint')
-rw-r--r--Makefile.maint12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile.maint b/Makefile.maint
index 3898dab41..f2b07a84d 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -84,7 +84,8 @@ syntax-check-rules = \
sc_system_h_headers \
sc_tight_scope \
sc_trailing_blank \
- sc_unmarked_diagnostics
+ sc_unmarked_diagnostics \
+ sc_useless_cpp_parens
syntax-check: $(syntax-check-rules)
# @grep -E '# *include <(limits|std(def|arg|bool))\.h>' \
@@ -248,6 +249,15 @@ sc_unmarked_diagnostics:
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
+# Avoid useless parentheses like those in this example:
+# #if defined (SYMBOL) || defined (SYM2)
+sc_useless_cpp_parens:
+ @( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
+ grep '^# *if .*defined *(' \
+ $$($(CVS_LIST) | grep -vEf .x-$@ ) && \
+ { echo '$(ME): found useless parentheses in cpp directive' \
+ 1>&2; exit 1; } || :
+
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N,
# which date accepts but GNU strftime does not.