mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Fix to make _Generic handle struct types properly.
Also, use an existing error message instead of creating a new equivalent one.
This commit is contained in:
parent
bccd86a627
commit
2de8ac993e
@ -1892,6 +1892,13 @@ var
|
||||
controllingType.kind := pointerType;
|
||||
controllingType.pType := expressionType;
|
||||
end {if}
|
||||
else if expressionType^.kind in [structType,unionType] then begin
|
||||
controllingType.size := expressionType^.size;
|
||||
controllingType.saveDisp := 0;
|
||||
controllingType.isConstant := false;
|
||||
controllingType.kind := definedType;
|
||||
controllingType.dType := expressionType;
|
||||
end {else if}
|
||||
else
|
||||
controllingType := expressionType^;
|
||||
if controllingType.kind = arrayType then
|
||||
@ -1910,7 +1917,7 @@ var
|
||||
TypeName; {get the type name}
|
||||
currentType := typeSpec;
|
||||
if (currentType^.size = 0) or (currentType^.kind = functionType) then
|
||||
Error(161);
|
||||
Error(133);
|
||||
tl := typesSeen; {check if it is a duplicate}
|
||||
while tl <> nil do begin
|
||||
if CompTypes(currentType, tl^.theType) then begin
|
||||
|
@ -699,7 +699,6 @@ if list or (numErr <> 0) then begin
|
||||
158: msg := @'_Generic expression includes two compatible types';
|
||||
159: msg := @'_Generic expression includes multiple default cases';
|
||||
160: msg := @'no matching association in _Generic expression';
|
||||
161: msg := @'complete object type expected';
|
||||
otherwise: Error(57);
|
||||
end; {case}
|
||||
writeln(msg^);
|
||||
|
Loading…
Reference in New Issue
Block a user