File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -597,6 +597,32 @@ void linkingt::duplicate_code_symbol(
597
597
old_symbol.location =new_symbol.location ;
598
598
}
599
599
}
600
+ // Linux kernel uses void f(void) as generic prototype
601
+ else if ((old_t .return_type ().id ()==ID_empty &&
602
+ old_t .parameters ().empty () &&
603
+ !old_t .has_ellipsis () &&
604
+ old_symbol.value .is_nil ()) ||
605
+ (new_t .return_type ().id ()==ID_empty &&
606
+ new_t .parameters ().empty () &&
607
+ !new_t .has_ellipsis () &&
608
+ new_symbol.value .is_nil ()))
609
+ {
610
+ // issue a warning
611
+ link_warning (
612
+ old_symbol,
613
+ new_symbol,
614
+ " ignoring conflicting void f(void) function declaration" );
615
+
616
+ if (old_t .return_type ().id ()==ID_empty &&
617
+ old_t .parameters ().empty () &&
618
+ !old_t .has_ellipsis () &&
619
+ old_symbol.value .is_nil ())
620
+ {
621
+ old_symbol.type =new_symbol.type ;
622
+ old_symbol.location =new_symbol.location ;
623
+ old_symbol.is_weak =new_symbol.is_weak ;
624
+ }
625
+ }
600
626
// mismatch on number of parameters is definitively an error
601
627
else if ((old_t .parameters ().size ()<new_t .parameters ().size () &&
602
628
!old_t .has_ellipsis ()) ||
You can’t perform that action at this time.
0 commit comments