Closed cheako closed 3 years ago
As soon as I add "${workspaceFolder}/**",
or "src/fundamental",
the problem returns.
Using "${workspaceFolder}/**" can cause problems if your workspace has files that match system headers.
Do you think there's a bug?
@sean-mcmanus when I said or
I actually meant xor
, sorry for not making that distinction. Yes, using "${workspaceFolder}/**"
gave me issues. I removed the all inclusive thing that was painful and "replaced" it with the more concise "src/fundamental"
. The pain didn't go away or even change. I'm unsure if src/fundamental
contains files that share the same name as system headers.
I'm no expert, but I'd guess/hope that -I"src/fundamental"
means something and that there are separate flags for <>
and ""
? I could do some experimenting, but that you're not suggesting one config option(IncludePath
) is equivalent to -I
and another is the for paths passed to whatever else controls how headers are found: concerns me.
So I can say for sure something is wrong with the above statement, if it's a bug I can't yet say.
If your build process uses -I "src/fundamental" and that compiles, then it's supposed to work the same for our tool, even with the same names (your build process would pick up the files in src/fundamental when there's a name conflict), unless you're missing some required compilerArgs.
Yeah, it sounds like it could be a bug. I'll see if I (or someone else) can get a repro.
@cheako
Also, the includePath needs "src/basic" for the macro.h header and it might need "src/fundamental" for other stuff in macro-fundamental.h. And ${workspaceFolder}/**
appears to correctly add those 2 folders (when I do C/C++: Log Diagnostics).
This issue has been closed automatically because it needs more information and has not had recent activity.
Type: LanguageService
From: https://github.com/microsoft/vscode-cpptools/issues/3145#issuecomment-469894523 https://github.com/microsoft/vscode-cpptools/issues/3145#issuecomment-469988599
I don't see where a new issue was created or what work further has been done.
Describe the bug
Macros seem to not being processed correctly. Examples
assert
,assert_return
,LIST_REMOVE
.assert_return(lease, -EINVAL);
Steps to reproduce
Expected behavior
Code and expansion look fine. A fix is in the details.
Logs
``` ------- Potential include path issues -------- Some headers exist in multiple locations. If IntelliSense is behaving incorrectly, try adding one of the alternate paths to the "includePath" in your configuration in c_cpp_properties.json to override the automatic path discovery for that header. Using: /usr/include/linux/if_ether.h Alternative: "/home/cheako/src/gitlab/systemd/src/basic" Using: /home/cheako/src/gitlab/systemd/src/basic/util.h Alternative: "/home/cheako/src/gitlab/systemd/src/boot/efi" ``` So I fixed that then got: ``` [2/28/2021, 10:29:20 AM] For C source files, IntelliSenseMode was changed from "linux-gcc-x64" to "linux-clang-x64" based on compiler args and querying compilerPath: "/usr/bin/clang" [2/28/2021, 10:29:20 AM] For C++ source files, IntelliSenseMode was changed from "linux-gcc-x64" to "linux-clang-x64" based on compiler args and querying compilerPath: "/usr/bin/clang" ``` All is now well, the fix: ``` mkdir -f .vscode cat >.vscode/c_cpp_properties.json <<'EOF' { "configurations": [ { "name": "Default", "includePath": [ "./src/basic", "./src/boot/efi" ], "intelliSenseMode": "linux-gcc-x64", "compilerPath": "/usr/bin/clang", "cStandard": "c17", "cppStandard": "c++14" } ], "version": 4 } EOF ```Screenshots
Additional context
Please make
C/C++: Log Diagnostics
more friendly. Saying to applyincludePath
toc_cpp_properties.json
has me thinking:I had to google to get at the correct syntax and it's a mess not to have some URLs, like for when git merges fail.