@@ -531,7 +531,7 @@ def full_call_graph(functions, **kwargs):
531
531
532
532
print_buf (std_buf , '"{}" -> "{}";' .format (func , caller ))
533
533
534
- if caller not in functions :
534
+ if ( caller not in functions ) or ( len ( functions [ caller ][ "files" ]) == 0 ) :
535
535
print_buf (std_buf , '"{}" [style=dashed]' .
536
536
format (caller ))
537
537
@@ -648,9 +648,9 @@ def main():
648
648
match = re .match (function , line )
649
649
if match is not None :
650
650
function_name = match .group ("function" )
651
- if function_name in functions :
651
+ if function_name in functions and functions [ function_name ][ "files" ] :
652
652
if not config .no_warnings :
653
- print_err ("WARNING: Function {} defined in multiple"
653
+ print_err ("WARNING: Function {} defined in multiple "
654
654
"files \" {}\" !" .
655
655
format (function_name ,
656
656
', ' .join (map (
@@ -673,6 +673,13 @@ def main():
673
673
match = re .match (call , line )
674
674
if match is not None :
675
675
target = match .group ("target" )
676
+ if not config .no_externs and target not in functions :
677
+ functions [target ] = dict ()
678
+ functions [target ]["files" ] = list ()
679
+ functions [target ]["calls" ] = dict ()
680
+ functions [target ]["refs" ] = dict ()
681
+ functions [target ]["callee_calls" ] = dict ()
682
+ functions [target ]["callee_refs" ] = dict ()
676
683
if target not in functions [function_name ]["calls" ]:
677
684
functions [function_name ]["calls" ][target ] = True
678
685
else :
0 commit comments