From 8bd1bbcec817443b20870d5220063c363ce7edb8 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 11 Mar 2018 17:23:27 -0400 Subject: [PATCH 1/2] Add missing PVS headers to new files --- src/nvim/os/lang.c | 3 +++ src/nvim/os/pty_process_win.c | 3 +++ src/nvim/viml/parser/parser.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/nvim/os/lang.c b/src/nvim/os/lang.c index f0bbf4b1cb..47c278ee97 100644 --- a/src/nvim/os/lang.c +++ b/src/nvim/os/lang.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #ifdef __APPLE__ # define Boolean CFBoolean // Avoid conflict with API's Boolean # include diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c index b90578edb7..a6774a6275 100644 --- a/src/nvim/os/pty_process_win.c +++ b/src/nvim/os/pty_process_win.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/viml/parser/parser.c b/src/nvim/viml/parser/parser.c index 08d8846018..8d26d08ea7 100644 --- a/src/nvim/viml/parser/parser.c +++ b/src/nvim/viml/parser/parser.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "nvim/viml/parser/parser.h" #ifdef INCLUDE_GENERATED_DECLARATIONS From 4e5e6506b51d3f952023df609b2b3e4469cbdc63 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 11 Mar 2018 18:01:44 -0400 Subject: [PATCH 2/2] pvscheck: Ignore exit code of pvs-studio-analyzer Since its typically non-zero, the script immediately exits instead of converting the binary log into useful formats. --- scripts/pvscheck.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 30c4d296d7..314966f6aa 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -343,13 +343,15 @@ run_analysis() {( cd "$tgt" + # pvs-studio-analyzer exits with a non-zero exit code when there are detected + # errors, so ignore its return pvs-studio-analyzer \ analyze \ --threads "$(get_jobs_num)" \ --output-file PVS-studio.log \ --verbose \ --file build/compile_commands.json \ - --sourcetree-root . + --sourcetree-root . || true plog-converter -t xml -o PVS-studio.xml PVS-studio.log plog-converter -t errorfile -o PVS-studio.err PVS-studio.log