diff --git a/Expression.pas b/Expression.pas index 9a801d0..ec5228a 100644 --- a/Expression.pas +++ b/Expression.pas @@ -1058,6 +1058,10 @@ var op^.left := Pop; kindRight := op^.right^.token.kind; kindLeft := op^.left^.token.kind; + if not (kind in [normalExpression,autoInitializerExpression]) then + if (kindLeft in [longlongconst,ulonglongconst]) + or (kindRight in [longlongconst,ulonglongconst]) then + Error(157); if kindRight in [intconst,uintconst,longconst,ulongconst] then begin if kindLeft in [intconst,uintconst,longconst,ulongconst] then begin if kind = preprocessorExpression then begin @@ -1378,6 +1382,9 @@ var else if not (op^.token.kind in [typedef,plusplusop,minusminusop,opplusplus,opminusminus,uand]) then begin + if not (kind in [normalExpression,autoInitializerExpression]) then + if op^.left^.token.kind in [longlongconst,ulonglongconst] then + Error(157); if (op^.left^.token.kind in [intconst,uintconst,longconst,ulongconst]) then begin diff --git a/Scanner.pas b/Scanner.pas index 96e807a..b5026cc 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -687,6 +687,7 @@ if list or (numErr <> 0) then begin 154: msg := @'lint: function declared _Noreturn can return or has unreachable code'; 155: msg := @'lint: non-void function may not return a value or has unreachable code'; 156: msg := @'invalid suffix on numeric constant'; + 157: msg := @'ORCA/C cannot evaluate this constant expression with long long operand(s)'; otherwise: Error(57); end; {case} writeln(msg^);