You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C extraction: a macro-argument identifier becomes a USAGE edge to a same-named struct field #2666
C extraction turns a macro-argument identifier into an edge to an unrelated struct field of the same name.
tests/test_main.c runs every suite through a macro, e.g. RUN_SELECTED_SUITE(mcp);. The argument mcp is a suite name, but the graph records a USAGE edge from main to whichever Field is named mcp: in one index openhands_fixture_t.mcp (char mcp[640] in tests/test_cli.c), in another cbm_daemon_application_session.mcp (src/daemon/application.c).
A data member that is only named as a macro argument is not used there, so the edge is wrong for every consumer (trace_path, impact, detect_changes, test-impact selection).
Repro: index this repository, then
query_graph: MATCH (m)-[r]->(f) WHERE m.name = 'main' AND m.file_path = 'tests/test_main.c' AND f.name = 'mcp' RETURN type(r), labels(f), f.qualified_name
returns USAGE, ["Field"], a struct member.
Expected: an identifier that appears only as a macro argument resolves to nothing, or at least never to a Field of an unrelated struct.
Found while making PR test selection narrow: the test-impact engine reached the runner's main through this edge and ran every test. The Smart CI PR guards the engine against it (an edge from the runner's main into a Field named like one of its suites no longer counts); this issue is the extractor fix itself.
Fixed on main by #2754 (merge commit 442989e), thanks to @gaurav0107: a bare C identifier that names no visible declaration no longer falls back to a same-named struct Field, so the macro-argument USAGE edge described here and the matching stray WRITES edges are gone. C++ and headers keep their member resolution unchanged.
Activity
fix(pipeline): a bare C reference never binds a struct Field
DeusData commentedon Oct 29, 2026
Fixed on main by #2754 (merge commit 442989e), thanks to @gaurav0107: a bare C identifier that names no visible declaration no longer falls back to a same-named struct Field, so the macro-argument USAGE edge described here and the matching stray WRITES edges are gone. C++ and headers keep their member resolution unchanged.