calls: false unresolved-site note for macro calls inside a dropped outer argument

Aperta
#192 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
devtools

Direzione di ricerca

Read the change documented in commit 0ef7d7a and trace the live-site list shared by calls and callchain, including how it handles scope and preprocessing. Reproduce the case with the provided drop.h and user.c example, then check where an enclosing macro drops an argument slot. Done means calls EXPR stays silent about an unresolved site when its only live site is inside that dropped argument.

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

Descrizione

In calls <MACRO>, a macro invocation inside an argument discarded by an enclosing macro still triggers the === Via Macros === unresolved-site warning, even though its actual resolves to a function name and the call is never expanded.

Reproducer

// drop.h
#define EXPR(f, x) f(x)
#define DROP(a) 0
int target(int v);

// user.c
#include "drop.h"
int target(int v) { return v; }
int duser(int v) { return DROP(EXPR(target, 1)); }

Querying calls EXPR prints === Via Macros === with the unresolved-site note (the index can reduce to a function name) instead of staying silent.

Cause

Introduced and documented in 0ef7d7a: the live-site list behind the warning checks scope and preprocessing, but does not check whether an enclosing macro drops the argument slot. Because that list is shared with callchain, the slot-drop check needs to live there rather than only in calls.

Expected behavior

calls EXPR should not emit a === Via Macros === unresolved-site warning when the only live site is inside a dropped outer macro argument.

Lingua principale
Rust
Stelle
187
Fork
53
Merge medio
1g 9h
PR unite (30g)
79

Preparare l'ambiente

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.

Altre issue di facebookexperimental/semcode

Tutte le issue di facebookexperimental/semcode

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.