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
Implement Advanced Function Call Detection for C Language Parser #118
Enhance search_for_called_function to support macro expansion and indirect function calls
Current implementation covers most common cases, this would add advanced edge cases
Description
The current search_for_called_function method in c_lang_function_parsers.py handles basic function call detection but skips advanced patterns that are common in real-world C codebases. Section 5 of the method is currently marked as "advanced, skip for now" but should be implemented to provide comprehensive function call analysis.
Current Implementation Status
The method currently supports:
✅ Direct function calls: callee_function(
✅ Struct member calls: obj->callee_function( or obj.callee_function(
✅ Function pointer variable calls: foo_ptr(
❌ Macro expansion and indirect calls (Section 5 - NOT IMPLEMENTED)
1. Macro Function Call Detection
Problem: Macros that expand to function calls are not detected.
Examples:
#defineCALL_FUNC(func, arg) func(arg)
#defineSAFE_CALL(func) if(func) func()
#defineDEBUG_CALL(func) func()
voidexample() {
CALL_FUNC(printf, "Hello"); // Should detect: printfSAFE_CALL(my_callback); // Should detect: my_callbackDEBUG_CALL(debug_print); // Should detect: debug_print
}
2. Function Pointer Array Access
Problem: Function calls through arrays are not detected.
Activity