summaryrefslogtreecommitdiff
path: root/maint.mk
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-06-16 21:16:07 -0600
committerJim Meyering <meyering@redhat.com>2008-06-17 08:17:14 +0200
commita7a328af0f7d087d8c664e7803a9f3a7479376c1 (patch)
treeac12bbb96c1d1da9e5de49b315c4411e01ed4746 /maint.mk
parent94cecb5cf6922130f10a640614fb2e16945c5432 (diff)
downloadcoreutils-a7a328af0f7d087d8c664e7803a9f3a7479376c1.tar.xz
ls, od: avoid redundant const
* src/ls.c (long_time_format, sort_functions): Avoid redundant const. * src/od.c (charname): Likewise. * maint.mk (sc_redundant_const): Add rule to detect this.
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/maint.mk b/maint.mk
index df6b7f3a6..5ba7b286c 100644
--- a/maint.mk
+++ b/maint.mk
@@ -483,6 +483,14 @@ sc_proper_name_utf8_requires_ICONV:
exit 1; } || :; \
fi
+# Warn about "c0nst struct Foo const foo[]",
+# but not about "char const *const foo" or "#define const const".
+sc_redundant_const:
+ @grep -E '\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
+ $$($(VC_LIST_EXCEPT)) && \
+ { echo 1>&2 '$(ME): redundant "const" in declarations'; \
+ exit 1; } || :
+
sc_const_long_option:
@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
| grep -Ev 'const struct option|struct option const' && { \