Summary
A function-defining macro whose only argument is the function name — FN_MACRO(name) { … } — is indexed under the wrong symbol, so calls to that function can't resolve. The multi-argument form MACRO(real_name, typed args…) was recovered in #1172; the single-argument form is still not covered.
Reproduction
#define NATIVE_FN(name) int name(void)
NATIVE_FN(get_version) { return 1; } // the macro argument IS the function name
int use_it(void) { return get_version(); } // calls the real name
int plain_func(void) { return 42; } // control
After codegraph init (1.4.1, latest release; same on current main):
| language / file |
source |
actual indexed name |
expected |
C .c |
NATIVE_FN(get_version) |
(get_version) |
get_version |
C++ .cpp |
NATIVE_FN(get_version) |
NATIVE_FN |
get_version |
| C/C++ |
int plain_func(void) |
plain_func |
✅ |
Because the real function is never stored under get_version:
codegraph callers get_version → Symbol "get_version" not found;
- the
use_it → get_version call reference is failed.
So the call edge is actually broken — this is not just a cosmetic name.
Why the #1172 recovery doesn't cover it
recoverCppMacroDefinedName requires the macro to have at least two arguments (the name plus at least one typed parameter, to stay unambiguous):
if (!params || params.namedChildCount < 2) return undefined;
(c-cpp.ts) A single-argument macro has one parameter, so it never reaches recovery and the wrong name is kept.
Impact
Calls to macro-defined functions don't resolve (missing caller/callee edges), so any analysis that relies on the call graph silently drops these functions; consumers that derive a symbol key or filename from the name also carry the stray parentheses (C) or macro name (C++).
Summary
A function-defining macro whose only argument is the function name —
FN_MACRO(name) { … }— is indexed under the wrong symbol, so calls to that function can't resolve. The multi-argument formMACRO(real_name, typed args…)was recovered in #1172; the single-argument form is still not covered.Reproduction
After
codegraph init(1.4.1, latest release; same on currentmain):.cNATIVE_FN(get_version)(get_version)get_version.cppNATIVE_FN(get_version)NATIVE_FNget_versionint plain_func(void)plain_funcBecause the real function is never stored under
get_version:codegraph callers get_version→Symbol "get_version" not found;use_it→get_versioncall reference isfailed.So the call edge is actually broken — this is not just a cosmetic name.
Why the #1172 recovery doesn't cover it
recoverCppMacroDefinedNamerequires the macro to have at least two arguments (the name plus at least one typed parameter, to stay unambiguous):(c-cpp.ts) A single-argument macro has one parameter, so it never reaches recovery and the wrong name is kept.
Impact
Calls to macro-defined functions don't resolve (missing caller/callee edges), so any analysis that relies on the call graph silently drops these functions; consumers that derive a symbol key or filename from the name also carry the stray parentheses (C) or macro name (C++).