mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Do not give a spurious error for redeclarations of a pascal function.
This could occur with strict type checking on, because the parameter types were compared at a point where they had been reversed for the original declaration but not for the subsequent one. Here is an example that would give an error: #pragma ignore 24 extern pascal void func(int, long); extern pascal void func(int, long);
This commit is contained in:
parent
4e59f4569f
commit
b5b276d0f4
48
Parser.pas
48
Parser.pas
@ -1735,21 +1735,21 @@ else if doingParameters then
|
||||
|
||||
if tPtr^.kind = functionType then begin {declare the identifier}
|
||||
if variable <> nil then begin
|
||||
if isPascal then begin
|
||||
{reverse the parameter list}
|
||||
p2 := tptr^.parameterList;
|
||||
p1 := nil;
|
||||
while p2 <> nil do begin
|
||||
p3 := p2;
|
||||
p2 := p2^.next;
|
||||
p3^.next := p1;
|
||||
p1 := p3;
|
||||
end; {while}
|
||||
tPtr^.parameterList := p1;
|
||||
end; {if}
|
||||
t1 := variable^.itype;
|
||||
if CompTypes(t1, tPtr) then begin
|
||||
if t1^.prototyped and tPtr^.prototyped then begin
|
||||
p2 := tptr^.parameterList;
|
||||
if isPascal then begin
|
||||
{reverse the parameter list}
|
||||
p1 := nil;
|
||||
while p2 <> nil do begin
|
||||
p3 := p2;
|
||||
p2 := p2^.next;
|
||||
p3^.next := p1;
|
||||
p1 := p3;
|
||||
end; {while}
|
||||
tPtr^.parameterList := p1;
|
||||
end; {if}
|
||||
p2 := tPtr^.parameterList;
|
||||
p1 := t1^.parameterList;
|
||||
while (p1 <> nil) and (p2 <> nil) do begin
|
||||
@ -1781,23 +1781,23 @@ if tPtr^.kind = functionType then begin {declare the identifier}
|
||||
end; {while}
|
||||
if p1 <> p2 then
|
||||
Error(47);
|
||||
p2 := tptr^.parameterList;
|
||||
if isPascal then begin
|
||||
{reverse the parameter list}
|
||||
p1 := nil;
|
||||
while p2 <> nil do begin
|
||||
p3 := p2;
|
||||
p2 := p2^.next;
|
||||
p3^.next := p1;
|
||||
p1 := p3;
|
||||
end; {while}
|
||||
tPtr^.parameterList := p1;
|
||||
end; {if}
|
||||
end; {if}
|
||||
end {if}
|
||||
else
|
||||
Error(42);
|
||||
1:
|
||||
if isPascal then begin
|
||||
{reverse the parameter list}
|
||||
p2 := tptr^.parameterList;
|
||||
p1 := nil;
|
||||
while p2 <> nil do begin
|
||||
p3 := p2;
|
||||
p2 := p2^.next;
|
||||
p3^.next := p1;
|
||||
p1 := p3;
|
||||
end; {while}
|
||||
tPtr^.parameterList := p1;
|
||||
end; {if}
|
||||
end; {if}
|
||||
end; {if}
|
||||
if tPtr^.kind = functionType then
|
||||
|
Loading…
Reference in New Issue
Block a user