Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcc analyzer native support #4030

Merged
merged 11 commits into from
Oct 16, 2023

Conversation

Szelethus
Copy link
Collaborator

WIP. Depends on #4011.

@Szelethus Szelethus added analyzer 📈 Related to the analyze commands (analysis driver) other-analyzer 💬 Analysers which CodeChecker offers only report conversion of, but no driving gcc 🐃 GNU GCC Static Analyzer labels Oct 5, 2023
@Szelethus Szelethus added this to the release 6.23.0 milestone Oct 5, 2023
@Szelethus Szelethus marked this pull request as draft October 5, 2023 07:33
@Szelethus Szelethus marked this pull request as ready for review October 9, 2023 15:03
@Szelethus Szelethus force-pushed the gcc_analyzer_native_support branch 3 times, most recently from 84a6396 to 472611b Compare October 10, 2023 14:17
Copy link
Contributor

@bruntib bruntib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analyzer/.coverage might have been committed accidentally.

analyzer/codechecker_analyzer/analyzers/gcc/analyzer.py Outdated Show resolved Hide resolved
config/labels/analyzers/gcc.json Outdated Show resolved Hide resolved
@@ -3,7 +3,8 @@
"analyzers": {
"clangsa": "clang",
"clang-tidy": "clang-tidy",
"cppcheck": "cppcheck"
"cppcheck": "cppcheck",
"gcc": "g++"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting question, how we could support both gcc and g++. Can this gcc analyzer analyze both .c and .cpp build actions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same thing we do with clang. As I understand, these are functionally the same:

clang++ == clang -x cpp
clang == clang++ -x c

Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not ready with the review. I try to install gcc13 and then
continue testing...

analyzer/codechecker_analyzer/analyzers/gcc/analyzer.py Outdated Show resolved Hide resolved
Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!
In general looks good.

config/labels/analyzers/gcc.json Outdated Show resolved Hide resolved
analyzer/codechecker_analyzer/analyzers/gcc/analyzer.py Outdated Show resolved Hide resolved
config/labels/analyzers/gcc.json Outdated Show resolved Hide resolved
docs/analyzer/user_guide.md Show resolved Hide resolved
@Szelethus
Copy link
Collaborator Author

I'm afraid you tested an outdated version :^) I'll see to the other comments ASAP.

@Szelethus Szelethus requested a review from dkrupp October 13, 2023 14:06
@Szelethus
Copy link
Collaborator Author

some error and warning messages look too aggessive

Looking at the current version of this PR, messages look right. Do you agree?

Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please change the used gcc binary to gcc instead of g++
  • please fix the error message for the gcc analyzer options

Then this is good to go for RC.

.github/workflows/install-deps.sh Show resolved Hide resolved
Config options for gcc.
"""
# TODO
return []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To return an empty list is valid here I think.

Now, I am getting this error:

workspace/test-projects/xerces-c]$ CodeChecker analyzers --analyzer-config gcc
[ERROR 2023-10-16 12:00] - Failed to get analyzer configuration options for 'gcc' analyzer! Please try to upgrade your analyzer version to use this feature.

However not supporting any option is not an error.

CodeChecker should write something like this instead:

No analyzer options supported for gcc.

@Szelethus Szelethus force-pushed the gcc_analyzer_native_support branch 2 times, most recently from f1ae95b to 058ecfe Compare October 16, 2023 13:11
@Szelethus
Copy link
Collaborator Author

please fix the error message for the gcc analyzer options

I intend to fix that with the alternative solution for #4041 (where we will have at least one analyzer config for each analyzer).

@Szelethus Szelethus requested a review from dkrupp October 16, 2023 14:56
Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please follow-up todos in later patches.

@bruntib bruntib merged commit bb3baa5 into Ericsson:master Oct 16, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) gcc 🐃 GNU GCC Static Analyzer other-analyzer 💬 Analysers which CodeChecker offers only report conversion of, but no driving
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants