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

Đang mở
#192 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
187
Fork
53
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
79

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của facebookexperimental/semcode

Tất cả issue của facebookexperimental/semcode

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.