C call graph: calls through a #define alias (failf -> Curl_failf) are not linked
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
Research direction
Start with the C call graph resolution path and the callgraph_triage.py reproducer described in the issue. Inspect how calls and object-like macro definitions are represented, then compare results against the libclang reference on the curl 7.30.0 corpus. Done means calls through function-alias macros link to their function targets, including the described guarded aliases, and call graph recall improves without introducing incorrect confident links.
Written by the indexing model from the issue text.
Description
What's wrong. In C, a call written through an object-like macro alias isn't linked to the function it names. curl 7.30.0 has #define failf Curl_failf at lib/sendf.h:48 (infof likewise). Calls written failf(data, ...) aren't linked to Curl_failf: lib/ftp.c has 43 such sites, imap.c 19, url.c 18, smtp.c 16, and so on. libclang resolves them through the macro. They make up most of the 293 not_extracted/other edges callgraph_triage reports for that snapshot, where call recall vs libclang 18.1.1 is 65.4%. Precision is unaffected: 0 wrong confident links.
Repro. Run tests/tools/callgraph_triage.py c with corpus_repos pointed at a curl-7_30_0 checkout, then read the not_extracted/other samples, e.g. lib/connect.c:1103 failf(data, "Connection time-out");.
Suggested fix shape. In C, an object-like macro whose whole body is one identifier naming a function defined in the repository is an alias: resolve a call to the macro as a call to that function. A guarded alias (curl's infof also has Curl_nop_stmt / (void) variants under #if) links from the branch that names a function. If the engine doesn't evaluate #if, it links to every branch's function target.
Impact. Under-counted call edges, so function fan-in, function PageRank and cross-file fcall edges are low for logging/error helpers in older C code bases that alias them. Modern curl calls Curl_failf directly, and its recall is 86.4%.
How it was found. The same temporal-crucible validation as #7827 (the include issue): gitgalaxy's own call_graph_resolution._score and callgraph_triage, run with the libclang reference on curl and nDPI snapshots. Write-up: squid-protocol/temporal-crucible branch validate/engine-c, docs/engine_validation.md.
🤖 Generated with Claude Code
- Dominant language
- Python
- Stars
- 57
- Forks
- 11
- Avg merge
- 1h 35m
- Merged PRs (30d)
- 975
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from squid-protocol/gitgalaxy
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
squid-protocol/gitgalaxy#7827 · 1 comment ·
Maintainers usually reply within 1 day
-
scope:frontier
Difficulty 5/5 Over a week Newbie friendliness 18/100
squid-protocol/gitgalaxy#7900 ·
Maintainers usually reply within 1 day
-
core-engine scope:infra testing
Difficulty 4/5 3-5 days Newbie friendliness 54/100
squid-protocol/gitgalaxy#7863 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
squid-protocol/gitgalaxy#7834 ·
Maintainers usually reply within 1 day
-
claim:melek scope:core
Difficulty 5/5 Over a week Newbie friendliness 25/100
squid-protocol/gitgalaxy#7709 · 46 comments ·
Maintainers usually reply within 1 day
All issues in squid-protocol/gitgalaxy
Similar issues
-
docs size:S
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
strawberry-graphql/strawberry#4794 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dataforgoodfr/cetolog#21 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
btclib-org/btclib#2932 ·
Maintainers usually reply within 1 day