microsoft / microsoft/vscode-cpptools

Intellisense support for gcc __attribute__((libcall)) not found

Aperta
#4,800 5 commenti 7 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Feature Request Language Service
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Type: LanguageService

Describe the bug
Certain c libraries use the ((libcall)) attribute in gcc to create interface structs for functions. What it does is it passes the interface base as first argument transparently when calling the function. Like this:

IInterface->SomeFunciton (arg1, arg2, etc);
becomes

IInterface->SomeFunction(IInterface, arg1, arg2, etc);
when constructing the call.

This is not supported in IntelliSense with the current c/c++. It would be a nice-to-have feature when working with these libraries.

  • OS and Version: Mac OS X, Windows, Chrome OS
  • VS Code Version: Latest
  • C/C++ Extension Version: Latest
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

To Reproduce

Copy/paste this in vscode and save as test.c:

`#ifdef amigaos4

#ifndef APICALL
#define APICALL attribute((libcall))
#endif

struct IntuitionIFace
{
unsigned int APICALL (*Obtain)(struct IntuitionIFace *Self, const char *arg1, char arg2);
unsigned int APICALL (*Release)(struct IntuitionIFace *Self, char arg3, short arg4);
} iface;

int main() {
struct IntuitionIFace *IIntuition = &iface;
//this below is the call
IIntuition->Obtain("Hello world", 'b');
}
#endif`

It will give am error squiggle at the end of last call.

Expected behavior

No error squiggle. The above compiles and runs with no errors in ppc-amigaos-gcc.

Screenshots

Additional context

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo la diagnostica in VS Code con l'esempio test.c fornito e verifica come IntelliSense gestisce le chiamate a puntatori a funzione con GCC attribute((libcall)). Il lavoro è completato quando la chiamata di esempio non produce più una sottolineatura ondulata errata, preservando al contempo il comportamento previsto degli argomenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, cpp
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.