From eb046f9d5902b2b45ece12503d31e6472cfa0b3e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 9 May 2008 08:11:13 +0000 Subject: [PATCH] sytnax-check: add a check for risky ctype macro use * Makefile.maint (sc_risky_ctype_macros): New rule. --- ChangeLog | 3 +++ Makefile.maint | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7e576be898..8453982a82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Fri May 9 10:01:34 EST 2008 Jim Meyering + sytnax-check: add a check for risky ctype macro use + * Makefile.maint (sc_risky_ctype_macros): New rule. + avoid one more ctype vs. sign-extension problem * src/util.c (TOLOWER): Also convert tolower argument. diff --git a/Makefile.maint b/Makefile.maint index ddf42bc689..bab8e1d069 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -302,6 +302,15 @@ sc_TAB_in_indentation: { echo '$(ME): found TAB(s) use for indentation; use spaces' \ 1>&2; exit 1; } || : +ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\ +|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper + +sc_risky_ctype_macros: + @grep -E '\b($(ctype_re)) *\(' /dev/null \ + $$($(VC_LIST_EXCEPT)) | grep -v to_uchar && \ + { echo '$(ME): found ctype macro use without to_uchar' \ + 1>&2; exit 1; } || : + # Match lines like the following, but where there is only one space # between the options and the description: # -D, --all-repeated[=delimit-method] print all duplicate lines\n