[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: maint.mk sc_prohibit_always-defined_macros complains about build-aux
From: |
Jim Meyering |
Subject: |
Re: maint.mk sc_prohibit_always-defined_macros complains about build-aux/warn-on-use.h |
Date: |
Wed, 26 May 2010 08:41:11 +0200 |
Bruno Haible wrote:
> Hi Eric,
>
>> While it may be possible to modify gnulib's warn-on-use.h to
>> avoid triggering this false positive in a comment
>
> Even better: Avoid the false positive. Jim has a sed expression for
> eliminating comments from C source code in cfg.mk [1]. You could use
> that as a filter, to avoid the false positive.
>
> Bruno
>
> [1] http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00257.html
If there end up being too many false positives not in gnulib-provided
files, I'll consider this. However, for now, I'd rather not, since
the current rule uses no temporary file and invokes grep just once:
sc_prohibit_always-defined_macros:
@if test -d $(gnulib_dir); then \
case $$(echo all: | grep -l -f - Makefile) in Makefile);; *) \
echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
esac; \
$(def_sym_regex) | grep -f - $$($(VC_LIST_EXCEPT)) \
&& { echo '$(ME): define the above via some gnulib .h file' \
1>&2; exit 1; } || :; \
fi
In order to grep filtered source and still give good diagnostics we'd
want to convert that to a loop over candidate files, which are then
filtered individually, and with grep applied to the resulting output.
That's not so bad, but with the rule above, I made an effort to avoid
creating a temporary file containing patterns (the input to grep -f -),
and with a loop, I might have to use a temporary file after all.