[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] Macro _prohibit_regexp replaced by _sc_search_regep and
From: |
Jim Meyering |
Subject: |
Re: [PATCH 3/3] Macro _prohibit_regexp replaced by _sc_search_regep and rules adapted to use the new macro. |
Date: |
Fri, 02 Apr 2010 07:57:40 +0200 |
Jim Meyering wrote:
...
>>>> # Don't use Texinfo @acronym{} as it is not a good idea.
>>>> sc_texinfo_acronym:
>>>> - @if $(VC_LIST_EXCEPT) | grep -lE '\.texi$$' >/dev/null; then \
>>>> - grep -nE '@acronym{' \
>>>> - $$($(VC_LIST_EXCEPT) | grep -E '\.texi$$') && \
>>>> - { echo '$(ME): found use of Texinfo @acronym{}' 1>&2; \
>>>> - exit 1; } || :; \
>>>> - else :; \
>>>> - fi
>>>> + @prohibit='@acronym{' \
>>>> + in_vc_files='\.texi$$' \
>>>> + halt='found use of Texinfo @acronym{}' \
>>>> + $(_sc_search_regexp)
>>>
>>> Jim mentioned that this rule should also look at *.txi and *.texinfo.
I didn't fix this part.
>>>> # #if HAVE_... will evaluate to false for any non numeric string.
>>>> # That would be flagged by using -Wundef, however gnulib currently
>>>> # tests many undefined macros, and so we can't enable that option.
>>>> # So at least preclude common boolean strings as macro values.
>>>> sc_Wundef_boolean:
>>>> - @test -e '$(CONFIG_INCLUDE)' && \
>>>> - grep -Ei '^#define.*(yes|no|true|false)$$' '$(CONFIG_INCLUDE)' && \
>>>> - { echo 'Use 0 or 1 for macro values' 1>&2; exit 1; } || :
>>>> + @prohibit='^#define.*(yes|no|true|false)$$' \
>>>> + in_vc_files='$(CONFIG_INCLUDE)' \
>>>> + halt='Use 0 or 1 for macro values' \
>>>> + $(_sc_search_regexp)
>>>
>>> $(CONFIG_INCLUDE) is not a controlled file. You need to use in_files
>>> instead.
However, I did fix this.
>>> Thanks again for doing this nice factorization.
>>
>> Good catch.
>> I've been testing this and will send feedback tomorrow.
...
>>From 3608d2c69ede63c74f594f1ef430c47972f75ca3 Mon Sep 17 00:00:00 2001
> From: Jose E. Marchesi <address@hidden>
> Date: Sun, 28 Mar 2010 13:35:24 +0200
> Subject: [PATCH 1/8] maint.mk: match 0 or more
> whitespace-before-function-call '('
I've folded those patches plus one more (here)
into your 3/3 and pushed the result:
commit 0509363a20ec5c023d6e1aedda178b7181603711
Author: Jim Meyering <address@hidden>
Date: Thu Apr 1 14:18:17 2010 +0200
sc_useless_cpp_parens: fix syntax error, backslash-esc open-paren
diff --git a/top/maint.mk b/top/maint.mk
index 6d04d34..9cfe172 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -617,7 +617,7 @@ sc_unmarked_diagnostics:
# Avoid useless parentheses like those in this example:
# #if defined (SYMBOL) || defined (SYM2)
sc_useless_cpp_parens:
- @prohibit '^# *if .*defined *(' \
+ @prohibit='^# *if .*defined *\(' \
halt='found useless parentheses in cpp directive' \
$(_sc_search_regexp)
- Re: [PATCH 3/3] Macro _prohibit_regexp replaced by _sc_search_regep and rules adapted to use the new macro.,
Jim Meyering <=