From 447643130c9e499f412268cc01305ea5256df04f Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 7 Oct 2020 15:24:39 +0200 Subject: coccinelle: correctly resolve our own macros Coccinelle can't do this automagically and requires we supply it respective header files. Unfortunately, the option for this (--macro-file=) can be used only once, so let's create our own macro file by collecting macros needed for the semantic parser to be happy. --- coccinelle/run-coccinelle.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'coccinelle/run-coccinelle.sh') diff --git a/coccinelle/run-coccinelle.sh b/coccinelle/run-coccinelle.sh index 1fdef5f63e..871547a881 100755 --- a/coccinelle/run-coccinelle.sh +++ b/coccinelle/run-coccinelle.sh @@ -31,12 +31,12 @@ if ! parallel -h >/dev/null; then exit 1 fi -for SCRIPT in ${@-$top/coccinelle/*.cocci} ; do +for SCRIPT in ${@-$top/coccinelle/*.cocci}; do echo "--x-- Processing $SCRIPT --x--" TMPFILE=`mktemp` echo "+ spatch --sp-file $SCRIPT $args ..." parallel --halt now,fail=1 --keep-order --noswap --max-args=20 \ - spatch --sp-file $SCRIPT $args ::: "${files[@]}" \ + spatch --macro-file="$top/coccinelle/macros.h" --sp-file $SCRIPT $args ::: "${files[@]}" \ 2>"$TMPFILE" || cat "$TMPFILE" echo -e "--x-- Processed $SCRIPT --x--\n" done -- cgit v1.2.1