Skip to content

Commit 50b6018

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 2157c1e commit 50b6018

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/linking/linking.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,17 @@ void linkingt::duplicate_code_symbol(
677677
if(!found)
678678
break;
679679
}
680+
// different non-pointer arguments with implementation - the
681+
// implementation is always right, even though such code may
682+
// be severely broken
683+
else if(pointer_offset_bits(t1, ns)==pointer_offset_bits(t2, ns) &&
684+
old_symbol.value.is_nil()!=new_symbol.value.is_nil())
685+
{
686+
if(warn_msg.empty())
687+
warn_msg="non-pointer parameter types differ between "
688+
"declaration and definition";
689+
replace=new_symbol.value.is_not_nil();
690+
}
680691
else
681692
break;
682693

0 commit comments

Comments
 (0)