-
Notifications
You must be signed in to change notification settings - Fork 379
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 #2458 from csordasmarton/fix_clang_tidy_context_fr…
…ee_hash [analyzer] Fix Clang Tidy context free hash generation
- Loading branch information
Showing
9 changed files
with
192 additions
and
46 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
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
57 changes: 57 additions & 0 deletions
57
...yzer/tests/functional/analyze_and_parse/test_files/context_free_hash_v2_clang_tidy.output
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,57 @@ | ||
NORMAL#CodeChecker log --output $LOGFILE$ --build "make context_hash" --quiet | ||
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=context-free-v2 --analyzer clang-tidy | ||
NORMAL#CodeChecker parse $OUTPUT$ --print-steps | ||
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=context-free-v2 --analyzer clang-tidy | ||
-------------------------------------------------------------------------------- | ||
[] - Starting build ... | ||
[] - Build finished successfully. | ||
[] - Starting static analysis ... | ||
[] - [1/1] clang-tidy analyzed context_hash.cpp successfully. | ||
[] - ----==== Summary ====---- | ||
[] - Successfully analyzed | ||
[] - clang-tidy: 1 | ||
[] - Total analyzed compilation commands: 1 | ||
[] - ----=================---- | ||
[] - Analysis finished. | ||
[] - To view results in the terminal use the "CodeChecker parse" command. | ||
[] - To store results use the "CodeChecker store" command. | ||
[] - See --help and the user guide for further options about parsing and storing the reports. | ||
[] - ----=================---- | ||
[HIGH] context_hash.cpp:23:23: suspicious usage of 'sizeof(K)'; did you mean 'K'? [bugprone-sizeof-expression] | ||
std::memset(buf, 0, sizeof(BUFLEN)); // sizeof(42) ==> sizeof(int) | ||
^ | ||
Report hash: 0f66553a0a3a129a00773b0e8ae42ca0 | ||
Steps: | ||
1, context_hash.cpp:23:23: suspicious usage of 'sizeof(K)'; did you mean 'K'? | ||
|
||
[HIGH] context_hash.cpp:34:23: suspicious usage of 'sizeof(K)'; did you mean 'K'? [bugprone-sizeof-expression] | ||
std::memset(buf, 0, sizeof(BUFLEN)); // sizeof(42) ==> sizeof(int) | ||
^ | ||
Report hash: 0f66553a0a3a129a00773b0e8ae42ca0 | ||
Steps: | ||
1, context_hash.cpp:34:23: suspicious usage of 'sizeof(K)'; did you mean 'K'? | ||
|
||
[HIGH] context_hash.cpp:37:21: suspicious usage of 'sizeof(K)'; did you mean 'K'? [bugprone-sizeof-expression] | ||
std::memset(buf, 0, sizeof(BUFLEN)); // sizeof(42) ==> sizeof(int) | ||
^ | ||
Report hash: 0f66553a0a3a129a00773b0e8ae42ca0 | ||
Steps: | ||
1, context_hash.cpp:37:21: suspicious usage of 'sizeof(K)'; did you mean 'K'? | ||
|
||
Found 3 defect(s) in context_hash.cpp | ||
|
||
|
||
----==== Summary ====---- | ||
------------------------------- | ||
Filename | Report count | ||
------------------------------- | ||
context_hash.cpp | 3 | ||
------------------------------- | ||
----------------------- | ||
Severity | Report count | ||
----------------------- | ||
HIGH | 3 | ||
----------------------- | ||
----=================---- | ||
Total number of reports: 3 | ||
----=================---- |
57 changes: 57 additions & 0 deletions
57
analyzer/tests/functional/analyze_and_parse/test_files/context_free_hash_v2_clangsa.output
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,57 @@ | ||
NORMAL#CodeChecker log --output $LOGFILE$ --build "make context_hash" --quiet | ||
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=context-free-v2 --analyzer clangsa | ||
NORMAL#CodeChecker parse $OUTPUT$ --print-steps | ||
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=context-free-v2 --analyzer clangsa | ||
-------------------------------------------------------------------------------- | ||
[] - Starting build ... | ||
[] - Build finished successfully. | ||
[] - Starting static analysis ... | ||
[] - [1/1] clangsa analyzed context_hash.cpp successfully. | ||
[] - ----==== Summary ====---- | ||
[] - Successfully analyzed | ||
[] - clangsa: 1 | ||
[] - Total analyzed compilation commands: 1 | ||
[] - ----=================---- | ||
[] - Analysis finished. | ||
[] - To view results in the terminal use the "CodeChecker parse" command. | ||
[] - To store results use the "CodeChecker store" command. | ||
[] - See --help and the user guide for further options about parsing and storing the reports. | ||
[] - ----=================---- | ||
[LOW] context_hash.cpp:8:3: Value stored to 'x' is never read [deadcode.DeadStores] | ||
x = 1; | ||
^ | ||
Report hash: 956cdff9afc6a5eca5478e218da0a3b2 | ||
Steps: | ||
1, context_hash.cpp:8:3: Value stored to 'x' is never read | ||
|
||
[LOW] context_hash.cpp:13:3: Value stored to 'x' is never read [deadcode.DeadStores] | ||
x = 1; | ||
^ | ||
Report hash: 956cdff9afc6a5eca5478e218da0a3b2 | ||
Steps: | ||
1, context_hash.cpp:13:3: Value stored to 'x' is never read | ||
|
||
[LOW] context_hash.cpp:19:3: Value stored to 'z' is never read [deadcode.DeadStores] | ||
z = 1; | ||
^ | ||
Report hash: 44ca8d5f4072148d92cfc3af541f1588 | ||
Steps: | ||
1, context_hash.cpp:19:3: Value stored to 'z' is never read | ||
|
||
Found 3 defect(s) in context_hash.cpp | ||
|
||
|
||
----==== Summary ====---- | ||
------------------------------- | ||
Filename | Report count | ||
------------------------------- | ||
context_hash.cpp | 3 | ||
------------------------------- | ||
----------------------- | ||
Severity | Report count | ||
----------------------- | ||
LOW | 3 | ||
----------------------- | ||
----=================---- | ||
Total number of reports: 3 | ||
----=================---- |
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