diff --git a/Parser.pas b/Parser.pas index 8de83b7..a344576 100644 --- a/Parser.pas +++ b/Parser.pas @@ -1966,14 +1966,19 @@ var errorFound := true; end; {else} tp := Subscript(tree^.left); - if tp^.kind <> arrayType then - Error(47) - else begin - tp := tp^.atype; - offset := offset + size*tp^.size; - Subscript := tp; - end; {else} end {if} + else begin + size := 0; + tp := Subscript(tree); + end; {else} + if tp^.kind = arrayType then begin + tp := tp^.atype; + offset := offset + size*tp^.size; + Subscript := tp; + end {if} + else if tp^.kind = functionType then begin + Subscript := tp; + end {else if} else begin Error(47); errorFound := true; @@ -2010,6 +2015,11 @@ var iPtr^.pName := ip^.name; end; {else} end {else if} + else if tree^.token.kind = stringConst then begin + Subscript := StringType(tree^.token.prefix); + iPtr^.isName := false; + iPtr^.pStr := tree^.token.sval; + end {else if} else begin Error(47); errorFound := true; diff --git a/cc.notes b/cc.notes index 67cac51..7a5be4e 100644 --- a/cc.notes +++ b/cc.notes @@ -1707,6 +1707,10 @@ int foo(int[42]); (Michael Hackett) +176. Certain address expressions (e.g. &"string"[1]) would cause spurious errors if they were used in the initializers of global or static variables. + +(Devin Reade) + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.