diff --git a/Parser.pas b/Parser.pas index cbf93f1..f1a5a39 100644 --- a/Parser.pas +++ b/Parser.pas @@ -1330,6 +1330,7 @@ var lLastParameter: identPtr; {next parameter to process} luseGlobalPool: boolean; {local copy of useGlobalPool} lSuppressMacroExpansions: boolean;{local copy of suppressMacroExpansions} + ldeclaredTagOrEnumConst: boolean; {local copy of declaredTagOrEnumConst} begin {StackDeclarations} lastWasIdentifier := false; {used to see if the declaration is a fn} @@ -1484,9 +1485,12 @@ var prototyped := true; {it is prototyped} repeat {collect the declarations} if token.kind in declarationSpecifiersElement then begin + ldeclaredTagOrEnumConst := declaredTagOrEnumConst; lLastParameter := lastParameter; DoDeclaration(true); lastParameter := lLastParameter; + declaredTagOrEnumConst := + ldeclaredTagOrEnumConst or declaredTagOrEnumConst; if protoType <> nil then begin wp := pointer(Malloc(sizeof(parameterRecord))); wp^.next := parameterList; diff --git a/Scanner.pas b/Scanner.pas index a8eb77a..e26e1b9 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -693,7 +693,7 @@ if list or (numErr <> 0) then begin 114: msg := @'a function call was made to a non-function'; 115: msg := @'illegal bit field declaration'; 116: msg := @'missing field name'; - 117: msg := @'field cannot have incomplete type'; + 117: msg := @'field cannot have incomplete or function type'; 118: msg := @'flexible array must be last member of structure'; 119: msg := @'inline specifier is only allowed on functions'; 120: msg := @'non-static inline functions are not supported';