maint: avoid doubled name in syntax check failures

Based on the similar gnulib commit 96ad9077.  The use of
$(_sc_search_regexp) already injects $(ME) into any output
messages, so a failure of these rules would look like this,
pre-patch:

maint.mk: maint.mk: use virStrToLong_*, not strtol variants

* cfg.mk (sc_prohibit_strncmp, sc_prohibit_strtol)
(sc_libvirt_unmarked_diagnostics): Drop redundant $(ME).
This commit is contained in:
Eric Blake 2012-09-04 17:40:04 -06:00
parent 44342a0efe
commit 60efb60018

8
cfg.mk
View File

@ -353,18 +353,18 @@ snp_ = strncmp *\(.+\)
sc_prohibit_strncmp:
@prohibit='! *strncmp *\(|\<$(snp_) *[!=]=|[!=]= *$(snp_)' \
exclude=':# *define STR(N?EQLEN|PREFIX)\(' \
halt='$(ME): use STREQLEN or STRPREFIX instead of str''ncmp' \
halt='use STREQLEN or STRPREFIX instead of str''ncmp' \
$(_sc_search_regexp)
# strtol and friends are too easy to misuse
sc_prohibit_strtol:
@prohibit='\bstrto(u?ll?|[ui]max) *\(' \
exclude='exempt from syntax-check' \
halt='$(ME): use virStrToLong_*, not strtol variants' \
halt='use virStrToLong_*, not strtol variants' \
$(_sc_search_regexp)
@prohibit='\bstrto[df] *\(' \
exclude='exempt from syntax-check' \
halt='$(ME): use virStrToDouble, not strtod variants' \
halt='use virStrToDouble, not strtod variants' \
$(_sc_search_regexp)
# Use virAsprintf rather than as'printf since *strp is undefined on error.
@ -550,7 +550,7 @@ func_re := ($(func_or))
sc_libvirt_unmarked_diagnostics:
@prohibit='\<$(func_re) *\([^"]*"[^"]*[a-z]{3}' \
exclude='_\(' \
halt='$(ME): found unmarked diagnostic(s)' \
halt='found unmarked diagnostic(s)' \
$(_sc_search_regexp)
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \