Code analysis functionality doesn't work on a cmake project, however works when clang-tidy is run manually #12992
Unanswered
Michał Zegan (webczat)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I have a cmake project (generally a C project, linux/gcc, using the libpipewire library).
When I run
clang-tidy -p build somefile.cit works properly, as in, somefile.c comes from source directory, andbuildis a cmake build dir.When I run code analysis from vscode, i get tons of errors, one per file, about errors in libpipewire header files. All these errors relate to some optional functions and stuff coming from locale.h.
For example:
I know that definition is introduced by defining some macros like _GNU_SOURCE, and if I actually do this, it starts working. However, normal cmake building and clang-tidy works without.
I think it's caused by the fact -std= is defined differently by default or in cmake builds, differently when running clang-tidy from vscode, as I can repro this when compiling any of these files and disabling language extensions.
Is this a cmake or c++ extension bug, or what?
All reactions