mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-03 10:29:41 +00:00
Fix so the result of sizeof has type unsigned long (i.e. size_t), not signed long.
The following test case demonstrates the problem: #include <stdio.h> int main (void) { if (sizeof(int) - 5 < 0) puts("error 1"); if (sizeof &main - 9 < 0) puts("error 2"); }
This commit is contained in:
parent
26a800e667
commit
5950002d03
@ -1188,7 +1188,7 @@ var
|
||||
op^.left := Pop;
|
||||
|
||||
if op^.token.kind = sizeofsy then begin
|
||||
op^.token.kind := longConst;
|
||||
op^.token.kind := ulongConst;
|
||||
op^.token.class := longConstant;
|
||||
if op^.left^.token.kind = stringConst then
|
||||
op^.token.lval := op^.left^.token.sval^.length+1
|
||||
@ -1604,7 +1604,7 @@ if token.kind in startExpression then begin
|
||||
sp^.left := nil;
|
||||
sp^.middle := nil;
|
||||
sp^.right := nil;
|
||||
sp^.token.kind := longconst;
|
||||
sp^.token.kind := ulongconst;
|
||||
sp^.token.class := longConstant;
|
||||
sp^.token.lval := typeSpec^.size;
|
||||
if typeSpec^.kind = arrayType then
|
||||
|
Loading…
Reference in New Issue
Block a user