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

オープン
#192 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
187
フォーク
53
平均マージ
1日 9時間
マージ済み PR(30日)
79

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

facebookexperimental/semcode のほかの issue

facebookexperimental/semcode の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。