Re: [PATCH] coccicheck: Allow for overriding spatch flags

From: Julia Lawall
Date: Sun Jun 12 2016 - 15:16:45 EST




On Sun, 12 Jun 2016, Deepa Dinamani wrote:

> Documentation/coccinelle.txt suggests using the SPFLAGS
> make variable to pass additional options to spatch.
>
> Reorder the way SPFLAGS is added to FLAGS, to allow
> for options in the SPFLAGS to override the default
> --very-quiet option.
>
> Similarly, rearrage the FLAGS for org or report mode.
> This allows for overriding of the default --no-show-diff
> option through SPFLAGS.

The first looks like a good idea, but do you find a use case for the
second? The diff that is shown in org or report mode may be sort of
random. It is just an easy hack to reuse the same pattern code for
context, org, and report modes, but there isn't an intent to see the diff
produced by context mode in org or report mode.

thanks,
julia


> Signed-off-by: Deepa Dinamani <deepa.kernel@xxxxxxxxx>
> Cc: Julia Lawall <Julia.Lawall@xxxxxxx>
> Cc: Gilles Muller <Gilles.Muller@xxxxxxx>
> Cc: Nicolas Palix <nicolas.palix@xxxxxxx>
> Cc: Michal Marek <mmarek@xxxxxxxx>
> ---
> scripts/coccicheck | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index dd85a45..f662786 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -25,7 +25,7 @@ else
> NPROC="$J"
> fi
>
> -FLAGS="$SPFLAGS --very-quiet"
> +FLAGS="--very-quiet $SPFLAGS"
>
> # spatch only allows include directories with the syntax "-I include"
> # while gcc also allows "-Iinclude" and "-include include"
> @@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then
> echo 'All available modes will be tried (in that order): patch, report, context, org'
> fi
> elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
> - FLAGS="$FLAGS --no-show-diff"
> + FLAGS="--no-show-diff $FLAGS"
> fi
>
> if [ "$ONLINE" = "0" ] ; then
> --
> 1.9.1
>
>