diff --git a/Parser.pas b/Parser.pas index cce68d6..bbb7346 100644 --- a/Parser.pas +++ b/Parser.pas @@ -3024,12 +3024,18 @@ var tp := v^.itype; {initialize the type pointer} while tp <> nil do begin {check all types} if tp^.kind = arrayType then {if it's an array with an unspecified } + begin if tp^.elements = 0 then { size and an unspecified size is not } if not firstVariable then { allowed here, flag an error. } begin Error(49); goto 1; end; {if} + if tp^.aType^.size = 0 then begin + Error(123); + goto 1; + end; {if} + end; {if} firstVariable := false; {unspecified sizes are only allowed in } { the first subscript } case tp^.kind of {next type...} diff --git a/Scanner.pas b/Scanner.pas index 16d0d44..a327b0a 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -610,6 +610,7 @@ if list or (numErr <> 0) then begin 120: msg := @'non-static inline functions are not supported'; 121: msg := @'invalid digit for binary constant'; 122: msg := @'arithmetic is not allowed on a pointer to an incomplete or function type'; + 123: msg := @'array element type may not be an incomplete or function type'; otherwise: Error(57); end; {case} writeln(msg^);