mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Allow type qualifiers for pointer types to be used in type names (in casts and sizeof expressions).
This fixes the compco09.c test case. This implementation permits duplicate copies of type qualifiers to appear. This is technically illegal in C90, but it’s legal in C99 and later, and ORCA/C already allows this in other contexts.
This commit is contained in:
parent
cf1cd085d8
commit
49ddf5abf1
@ -1438,12 +1438,20 @@ var
|
||||
|
||||
{create a pointer type}
|
||||
NextToken;
|
||||
AbstractDeclarator;
|
||||
tp := pointer(Malloc(sizeof(typeRecord)));
|
||||
tp^.size := cgLongSize;
|
||||
tp^.saveDisp := 0;
|
||||
tp^.isConstant := false;
|
||||
tp^.kind := pointerType;
|
||||
while token.kind in [constsy,volatilesy] do begin
|
||||
if token.kind = constsy then
|
||||
tp^.isConstant := true
|
||||
else {if token.kind = volatilesy then}
|
||||
if not doingSizeof then
|
||||
volatile := true;
|
||||
NextToken;
|
||||
end; {while}
|
||||
AbstractDeclarator;
|
||||
tp^.fType := tl;
|
||||
tl := tp;
|
||||
end {else if token.kind = asteriskch}
|
||||
|
Loading…
Reference in New Issue
Block a user