-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Environment
- OS and Version: Windows 11
- VS Code Version: 1.102
- C/C++ Extension Version:
- If using SSH remote, specify OS of remote machine: Linux (4.18.0-477.15.1.el8_8.x86_64)
Bug Summary and Steps to Reproduce
Bug Summary:
When a c file includes headers which resolve to symlinks, it seems that vscode (clang in particular) is not able to find the first instance of the include. If the same file is included multiple times, it is able to resolve the second and subsequent includes.
Details:
I have a workspace, which is an SSH to a linux machine. My workspace is huge (tens of thousands of files), but the ones of import are in a tree structure similar to the following:
devel/
+ linkfarm/
+ product1/
+ includes/
+ syslib/
+ syslib.h -> (symlink to ../../../syslib_v2/includes/syslib.h)
+ segalloc/
+ segalloc.h -> (symlink to ../../../segalloc_v3/includes/segalloc.h)
+ syslib_v2/
+ includes/
+ syslib.h
+ segalloc_v3/
+ includes/
+ segalloc.h
+ prog1/
+ prog1.c
The prog1.c has the following lines of code:
/* prog1 header... */
#include <stddef.h>
#include <stdio.h>
#include <syslib/syslib.h>
#include <syslib/syslib.h>
#include <segalloc/segalloc.h>
Note that these point to the syslib.h in the syslib directory (thus it refers to the symlink as opposed to the actual file). Out of these, only the first #include of <syslib/syslib.h>
is underlined, and I get a message file not found clang (pp_file_not_found)
. No other include is highlighted as being an error.
Other notes: I reinstalled git with symlinks enabled to rule out this being an issue with the symlinks. I also checked, and I can manually open syslib/syslib.h in VsCode if I specify the full path to the symlink, so vscode can definitely see and read the symlink file.
Steps to reproduce:
(see detailed description -- basically, try to include a file which is a symlink, that is pointing to a relative directory over SSH, with clang)
Expected behavior:
Expect it to be able to resolve the symlink as if it were a regular file
Configuration and Logs
c_cpp_properties.json:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
I do not seem to have a `C/C++: Log Diagnostics` in my command pallette..
Other Extensions
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status