summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-10-09 12:58:12 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-11-02 14:32:59 +0000
commit1c31822f6777e980b9966c2d3caa4e3345f5cedd (patch)
treeede3b0b82a71c52aa7eec39f56c6004c3eca2c4f
parent07ec19cdabfd832072fcd25e917a845506d34977 (diff)
scripts: Sanity check that tartan is not run recursively
If so, the inner instance should act as a no-op to avoid the terrible situation of the analyser being run on the tartan binary itself, which results in a scrollback entirely filled by warnings about nul bytes.
-rwxr-xr-xscripts/tartan8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/tartan b/scripts/tartan
index dbb89e1..d860e12 100755
--- a/scripts/tartan
+++ b/scripts/tartan
@@ -114,6 +114,14 @@ elif ! containsElement "-analyze" "${argv[@]}"; then
echo "Warning: Running $0 with static analysis disabled. Use tartan-build to enable static analysis." >& 2
fi
+# Sanity check that (somehow) the Tartan plugin flags have not already made it
+# into the argument list. This can happen if both configure and make are run
+# under tartan-builder.
+if [ "$include_plugin_flags" = "1" ] &&
+ containsElement "$plugin_path" "${argv[@]}"; then
+ include_plugin_flags=0
+fi
+
# The -analyzer-checker argument loads all 'tartan.*' static checkers.
# The -add-plugin argument loads the tartan AST frontend plugin.
add_plugin=( "-load" "$plugin_path" \