-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
C/C++ analysis and #include completion interprets "-iquote" as "-I" #12198
Comments
@l-inc Can you try setting |
@sean-mcmanus, from what I can see, it completely breaks the analysis: all diagnostic warnings disappear. The equivalent language server log is then as large as this:
Besides, I don't think that the problem is limited to clang-tidy. The auto-completion doesn't work for the symbols from the affected headers either. P.S.
|
@l-inc Okay, yeah, you should keep |
@sean-mcmanus, thanks a lot. That's quite fast. P.S. Does the fix also cover the same problem with auto-completion? |
@l-inc The code was already setup to handle -isystem from the fix for #9366 (so -iquote handling was trivial to add). I wasn't initially understanding what you meant by "auto-completion", but I figured out you're referring to the |
@sean-mcmanus, I meant the auto-completion of symbols in the headers. E.g., if the function/macro "assert()" is available in I asked because I assumed that clang-tidy was an independent piece of infrastructure, whereas the auto-completion was featured by a separate parser, such as EDG. However, if you say that the auto-completion of the header names will work, then my question is anyway answered. Thank you. |
@l-inc I've filed bug #12207 -- our EDG parser supports handling it, but we're not sending it the correct arguments (I'm not sure of an ETA for that fix...it's currently in the next milestone, but that could change), so the IntelliSense-based features aren't fixed, just clang-tidy and |
@l-inc Code analysis and |
@sean-mcmanus, thank you. |
@l-inc We fixed the IntelliSense handling of -iquote/isystem with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.21.0, so let us know you're still seeing any issues with that scenario. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
We use automatically generated "compile_commands.json" to pass the exact command line arguments per translation unit (which differ for different translation units). We further use "-iquote" for the internal include directories of the project.
When issuing "C/C++ Log Diagnostics", the "Includes:" correctly lists the include directories and "compile_commands.json entry" correctly lists all command line parameters including the include directories. However, when running "C/C++ Run Code Analysis on Active File", the output log shows that all the command line parameters preceded by "-iquote" in "compile_commands.json" are preceded with "-I" instead (in contrast, "-isystem" correctly precedes the default includes of the GCC toolchain). As a result, some of the headers of the GCC toolchain (e.g.,
#include <assert.h>
) are instead taken from our project's internal directories, leading to the incorrect analysis.Steps to reproduce:
Expected behavior:
"-iquote" is interpreted as "-iquote" (not as "-I") by the C/C++ analysis.
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: