mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-04-14 19:37:03 +00:00
Allow floating literals that are immediately cast to integer types to appear in integer constant expressions.
The C standards say these should be permitted. The following declaration shows an example: int a[(int)5.5];
This commit is contained in:
parent
0cf948e3bd
commit
7fa74d1183
@ -1562,6 +1562,13 @@ if token.kind in startExpression then begin
|
||||
if token.kind in [stringconst,doubleconst] then begin
|
||||
if kind = arrayExpression then begin
|
||||
op := opStack;
|
||||
if token.kind = doubleconst then
|
||||
if op <> nil then
|
||||
if op^.token.kind = castoper then
|
||||
if op^.casttype^.kind = scalarType then
|
||||
if op^.casttype^.baseType in [cgByte,cgUByte,
|
||||
cgWord,cgUWord,cgLong,cgULong] then
|
||||
goto 3;
|
||||
while op <> nil do begin
|
||||
if op^.token.kind = sizeofsy then
|
||||
goto 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user