summaryrefslogtreecommitdiff
path: root/coccinelle/run-coccinelle.sh
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2020-10-07 15:24:39 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2020-10-09 14:48:40 +0200
commit447643130c9e499f412268cc01305ea5256df04f (patch)
tree98a6e22c831ad04405b07df9b297dfe5582dbf39 /coccinelle/run-coccinelle.sh
parentd156a4fa0f2829047879184c161ad7ae0092b91c (diff)
downloadsystemd-447643130c9e499f412268cc01305ea5256df04f.tar.gz
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.
Diffstat (limited to 'coccinelle/run-coccinelle.sh')
-rwxr-xr-xcoccinelle/run-coccinelle.sh4
1 files changed, 2 insertions, 2 deletions
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