microsoft / microsoft/vscode-cpptools
IntelliSense cannot find structure member references
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Environment
Latest everything:
Version: 1.93.1 (system setup)
Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Date: 2024-09-11T17:20:05.685Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045
Bug Summary and Steps to Reproduce
Consider the following code (test.c):
#include <stdio.h>
#include <stdlib.h>
typedef unsigned int uint4;
typedef signed int int4;
typedef unsigned short uint2;
typedef signed short int2;
typedef unsigned char uint1;
typedef signed char int1;
#if defined(_MSC_VER)
# define PACKED(...) \
__pragma(pack(push, 1)) \
__VA_ARGS__ \
__pragma(pack(pop))
#else
# if defined(__GNUC__)
# define PACKED(...) \
__VA_ARGS__ \
__attribute__((packed))
# endif
#endif
PACKED(struct S_newstruct {
uint1 member1;
uint2 member2[2];
uint4 sys$member3;
uint4 sys$member4[2];
});
int main(void)
{
struct S_newstruct* s = malloc(sizeof(*s));
printf("%u\n", s->member1);
return 0;
}
If you try to "Go to references" while on member1 in the definition of structure S_newstruct, you'll get "No references found", not even that in the printf() statement in main(). That's very unexpected, and makes IntelliSense basically useless.
Configuration and Logs
$ cat .vscode/c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"_GNU_SOURCE=1",
"__CYGWIN__"
],
"compilerPath": "C:/cygwin64/bin/gcc.exe",
"compilerArgs": [ "-fms-extensions" ],
"cStandard": "c17",
"cppStandard": "c++17"
}
],
"version": 4
}
Other Extensions
No response
Additional context
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il risultato di riferimento mancante usando test.c e la configurazione in .vscode/c_cpp_properties.json, con le impostazioni del compilatore Cygwin mostrate. Parti dal punto di ingresso di IntelliSense "Go to references" per la definizione di member1. Il lavoro è completato quando i riferimenti dalla definizione della struttura includono l’uso di member1 in main().
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, vscode
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100