You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CodeChecker version 6.15.2 (snap package) filters out the "-imacros" compiler option from a compilation database. This can lead to a compilation failure during analysis, due to missing macro definitions.
When those options are global for a project, it is possible to work around this by adding those options to 2 files, for clangsa and clang-tidy. For clangsa, using CodeChecker "--saargs" option, the content will be lines like:
-imacros /path/to/header/file1.h
...
This amounts to passing the options directly to clang. However clang-tidy does not support this option directly, so a two level bypass is needed. Using "--tidyargs", construct a file with:
This tells CodeChecker to tell clang-tidy to pass the option to the underlying clang compiler two steps down ;)
It would be nice if CodeChecker would not filter out "-imacros " arguments when calling clangsa, as clangsa can support this natively. For clang-tidy it could be possibly to automate the above work-around, but it doesn't preserve the command line ordering. This would require a change in clang-tidy itself to directly support "-imacros". Even if CodeChecker doesn't want to include a half-baked work-around, this issue may help some people.
As a example the Zephyr open source RTOS uses "-macros" for the system configuration.
Thanks
The text was updated successfully, but these errors were encountered:
I think we already fixed this as per another user's request, see #3428. I'm not sure which release it went or will go into, the Milestone field says 6.17.1 and the commit is not associated with any branch apart from master.
Could you please try with a newer version, or preferably, for the sake of testing, a self-compiled version of CodeChecker?
As a example the Zephyr open source RTOS uses "-macros" for the system configuration.
@yalfg-macros or -imacros? Was that a typo from your side, or is there actually a -macros flag? Because the entirety of the investigation that led up to #3428 involved that we figured out that we accidentally typod -macros into CodeChecker's source code at an earlier refactoring, which broke the support of this flag...
CodeChecker version 6.15.2 (snap package) filters out the "-imacros" compiler option from a compilation database. This can lead to a compilation failure during analysis, due to missing macro definitions.
When those options are global for a project, it is possible to work around this by adding those options to 2 files, for clangsa and clang-tidy. For clangsa, using CodeChecker "--saargs" option, the content will be lines like:
This amounts to passing the options directly to clang. However clang-tidy does not support this option directly, so a two level bypass is needed. Using "--tidyargs", construct a file with:
This tells CodeChecker to tell clang-tidy to pass the option to the underlying clang compiler two steps down ;)
It would be nice if CodeChecker would not filter out "-imacros " arguments when calling clangsa, as clangsa can support this natively. For clang-tidy it could be possibly to automate the above work-around, but it doesn't preserve the command line ordering. This would require a change in clang-tidy itself to directly support "-imacros". Even if CodeChecker doesn't want to include a half-baked work-around, this issue may help some people.
As a example the Zephyr open source RTOS uses "-macros" for the system configuration.
Thanks
The text was updated successfully, but these errors were encountered: