diff --git a/Parser.pas b/Parser.pas index da45626..050d1d6 100644 --- a/Parser.pas +++ b/Parser.pas @@ -4069,6 +4069,7 @@ var var pcount: integer; {paren counter} tp: typePtr; {work pointer} + ltypeSpec: typePtr; {copy of type specifier} begin {NonEmptyAbstractDeclarator} if token.kind = lparench then begin @@ -4138,7 +4139,9 @@ var if token.kind = rbrackch then expressionValue := 0 else begin + ltypeSpec := typeSpec; Expression(arrayExpression, [rbrackch]); + typeSpec := ltypeSpec; if expressionValue <= 0 then begin Error(45); expressionValue := 1; diff --git a/cc.notes b/cc.notes index 17dc6fb..6e77d47 100644 --- a/cc.notes +++ b/cc.notes @@ -1697,6 +1697,8 @@ int foo(int[42]); 172. When certain negative integers that are multiples of 65536 were converted from floating-point types to long, long long, or comp, an incorrect value might be produced due to a bug in SANE. ORCA/C now includes workarounds to avoid this bug in several situations, although it might still occur in certain other ones. +173. sizeof could give the wrong value if the type contained a nested use of a type name within an array length expression, e.g. sizeof(short[(long)50]). + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.