* 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.
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' && { \
/* strftime formats for non-recent and recent files, respectively, in
-l output. */
-static const char const *long_time_format[2] =
+static char const *long_time_format[2] =
{
/* strftime format for non-recent files (older than 6 months), in
-l output. This should contain the year, month and day (at
} \
}
-static const qsortFunc const sort_functions[][2][2][2] =
+static qsortFunc const sort_functions[][2][2][2] =
{
LIST_SORTFUNCTION_VARIANTS (name),
LIST_SORTFUNCTION_VARIANTS (extension),
verify (sizeof width_bytes / sizeof width_bytes[0] == N_SIZE_SPECS);
/* Names for some non-printing characters. */
-static const char const charname[33][4] =
+static char const charname[33][4] =
{
"nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel",
"bs", "ht", "nl", "vt", "ff", "cr", "so", "si",