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

--ctu flag not handled during analysis #4233

Open
mcserep opened this issue May 2, 2024 · 3 comments
Open

--ctu flag not handled during analysis #4233

mcserep opened this issue May 2, 2024 · 3 comments
Labels
analyzer 📈 Related to the analyze commands (analysis driver) clang sa 🐉 The Clang Static Analyzer is a source code analysis tool that finds bugs in C-family programs. config ⚙️ documentation 📖 Changes to documentation. question ❔

Comments

@mcserep
Copy link

mcserep commented May 2, 2024

Describe the bug
The documentation states that Cross Translation Unit Analysis can be enabled with the --ctu flag. Using this flag is also included in the GitLab CI tutorial.

The flag is not recognized, instead the CodeChecker: error: unrecognized arguments: --ctu message is printed.

CodeChecker version
6.23.1

To Reproduce
Steps to reproduce the behaviour:

  1. Run command: CodeChecker analyze --ctu -o ./reports ./compile_commands.json
  2. See error

Expected behaviour
The Cross Translation Unit Analysis is performed when the --ctu flag is passed.

Desktop

  • OS: Linux
  • Browser: N/A
  • Version: N/A
@whisperity
Copy link
Member

What is the Clang version on the machine? The --ctu flag is conditionally enabled based on the Clang available in the system. You'll need a new enough clang and clang-extdef-mapping in the PATH.

@whisperity whisperity added question ❔ analyzer 📈 Related to the analyze commands (analysis driver) clang sa 🐉 The Clang Static Analyzer is a source code analysis tool that finds bugs in C-family programs. config ⚙️ documentation 📖 Changes to documentation. labels May 2, 2024
@mcserep
Copy link
Author

mcserep commented May 2, 2024

Thanks for the quick response @whisperity.
That was indeed the source of the issue. (Clang SA was not made properly available on the PATH due to some typo in the CI configuration I am working on.)

In that case I think the given error message is highly misleading, since CodeChecker has a separate error message for cases when clangsa (or any other analyzer) is not found on the PATH. In my opinion in this case that error message should have been printed, instead of stating that a documented flag (--ctu) is not recognized.

@whisperity
Copy link
Member

Yeah the problems is that argparse hijacks the execution to throw a full error from parse_args() before we could detect the actual lack of CTU options... Will have to come up with a solution for this problem.

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) clang sa 🐉 The Clang Static Analyzer is a source code analysis tool that finds bugs in C-family programs. config ⚙️ documentation 📖 Changes to documentation. question ❔
Projects
None yet
Development

No branches or pull requests

2 participants