mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-21 21:32:00 +00:00
Give an error if a function pointer is redefined as a function.
This gives an error for code like the following, which was previously allowed: void (*p)(int); void p(int i) {} Note that the opposite order still does not give a compiler error, but does give linker errors. Making sure we give a compiler error for all similar cases would require larger changes, but this patch at least catches some erroneous cases that were previously being allowed.
This commit is contained in:
parent
61a382de0b
commit
3b35a65b1d
@ -1748,7 +1748,7 @@ if tPtr^.kind = functionType then begin {declare the identifier}
|
|||||||
tPtr^.parameterList := p1;
|
tPtr^.parameterList := p1;
|
||||||
end; {if}
|
end; {if}
|
||||||
t1 := variable^.itype;
|
t1 := variable^.itype;
|
||||||
if CompTypes(t1, tPtr) then begin
|
if (t1^.kind = functionType) and CompTypes(t1, tPtr) then begin
|
||||||
if t1^.prototyped and tPtr^.prototyped then begin
|
if t1^.prototyped and tPtr^.prototyped then begin
|
||||||
p2 := tPtr^.parameterList;
|
p2 := tPtr^.parameterList;
|
||||||
p1 := t1^.parameterList;
|
p1 := t1^.parameterList;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user