From 30f8b49d3b7917a15237724a0d0b913d27e876e2 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 12 Oct 2018 10:09:11 +0300 Subject: [PATCH 1/4] Silence SC2034 shellcheck checker for EXTRA_CHECKERS and NOISY_CHECKERS variables --- scripts/test/scan-build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/test/scan-build.sh b/scripts/test/scan-build.sh index 8d126cbcee..e111566bf7 100755 --- a/scripts/test/scan-build.sh +++ b/scripts/test/scan-build.sh @@ -33,6 +33,7 @@ CHECKERS="\ -enable-checker security.insecureAPI.strcpy \ " +# shellcheck disable=SC2034 # These have high false-positive rates. EXTRA_CHECKERS="\ -enable-checker alpha.security.ArrayBoundV2 \ @@ -40,6 +41,7 @@ EXTRA_CHECKERS="\ -enable-checker alpha.core.CastSize \ " +# shellcheck disable=SC2034 # These don't seem to generate anything useful NOISY_CHECKERS="\ -enable-checker alpha.clone.CloneChecker \ From d6eafd06a9797d2747b0bd5988893c292076ef1f Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 12 Oct 2018 10:37:27 +0300 Subject: [PATCH 2/4] Add changes file --- changes/ticket28007 | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changes/ticket28007 diff --git a/changes/ticket28007 b/changes/ticket28007 new file mode 100644 index 0000000000..1ac87862eb --- /dev/null +++ b/changes/ticket28007 @@ -0,0 +1,3 @@ + o Code simplification and refactoring: + - Cleanup scan-build.sh to silence shellcheck warnings. + Closes ticket 28007. From 59001a69c96a2f14821d312b10482c0854c6d7dd Mon Sep 17 00:00:00 2001 From: rl1987 Date: Mon, 26 Nov 2018 18:03:36 +0200 Subject: [PATCH 3/4] Address SC2086 in scan-build.sh We can safely silence SC2086 warning on $CHECKERS, as contents of that is hardcoded into script, and we don't want to require Bash to use Bash array here. Double-quote $OUTPUTARG, as it's value depends on environment variable. --- scripts/test/scan-build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/test/scan-build.sh b/scripts/test/scan-build.sh index e111566bf7..9a63383804 100755 --- a/scripts/test/scan-build.sh +++ b/scripts/test/scan-build.sh @@ -54,6 +54,7 @@ else OUTPUTARG="" fi +# shellcheck disable=SC2086 scan-build \ $CHECKERS \ ./configure @@ -63,13 +64,15 @@ scan-build \ # Make this not get scanned for dead assignments, since it has lots of # dead assignments we don't care about. +# shellcheck disable=SC2086 scan-build \ $CHECKERS \ -disable-checker deadcode.DeadStores \ make -j5 -k ./src/ext/ed25519/ref10/libed25519_ref10.a +# shellcheck disable=SC2086 scan-build \ - $CHECKERS $OUTPUTARG \ + $CHECKERS "$OUTPUTARG" \ make -j5 -k CHECKERS="\ From da264f7c766b332f596a92766f7625c4a17abf70 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Sat, 8 Dec 2018 15:15:20 +0200 Subject: [PATCH 4/4] Let's not double-quote OUTPUTARG after all --- scripts/test/scan-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test/scan-build.sh b/scripts/test/scan-build.sh index 9a63383804..26e05ff101 100755 --- a/scripts/test/scan-build.sh +++ b/scripts/test/scan-build.sh @@ -72,7 +72,7 @@ scan-build \ # shellcheck disable=SC2086 scan-build \ - $CHECKERS "$OUTPUTARG" \ + $CHECKERS $OUTPUTARG \ make -j5 -k CHECKERS="\