Skip to content

Commit 7a09ada

Browse files
committed
Accept more mismatching function definition/declaration pairs
As long as the bit-width of parameters matches, we should be able to obtain sane results.
1 parent b13cf7f commit 7a09ada

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/linking/linking.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,17 @@ void linkingt::duplicate_code_symbol(
703703
if(!found)
704704
break;
705705
}
706+
// different non-pointer arguments with implementation - the
707+
// implementation is always right, even though such code may
708+
// be severely broken
709+
else if(pointer_offset_bits(t1, ns)==pointer_offset_bits(t2, ns) &&
710+
old_symbol.value.is_nil()!=new_symbol.value.is_nil())
711+
{
712+
if(warn_msg.empty())
713+
warn_msg="non-pointer parameter types differ between "
714+
"declaration and definition";
715+
replace=new_symbol.value.is_not_nil();
716+
}
706717
else
707718
break;
708719

0 commit comments

Comments
 (0)