forked from tree-sitter/tree-sitter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tree-sitter#77 from philipturnbull/scan-build-fixes
Fix errors found by scan-build
- Loading branch information
Showing
8 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
set -e | ||
|
||
. script/lib.sh | ||
|
||
script/fetch-fixtures | ||
script/check-mallocs | ||
script/test | ||
script/test -b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
function scan_build { | ||
extra_args=() | ||
|
||
# AFAICT, in the trusty travis container the scan-build tool is from the 3.4 | ||
# installation. Therefore, by default it will use clang-3.4 when analysing code | ||
# which doesn't support the '-std=c++14' (it is available via '-std=c++1y'). | ||
# Use the system-wide installed clang instead which is 3.5 and does support | ||
# '-std=c++14'. | ||
extra_args+=("--use-analyzer=$(which clang)") | ||
|
||
# scan-build will try to guess which CXX should be used to compile the actual | ||
# code, which is usually g++ but we need g++5 in the CI. Explicitly pass | ||
# $CC/$CXX to scan-build if they are set in the environment. | ||
|
||
if [[ ! -z "$CC" ]]; then | ||
extra_args+=("--use-cc=$CC") | ||
fi | ||
|
||
if [[ ! -z "$CXX" ]]; then | ||
extra_args+=("--use-c++=$CXX") | ||
fi | ||
|
||
scan-build "${extra_args[@]}" --status-bugs -disable-checker deadcode.DeadStores "$@" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters