diff --git a/Symbol.pas b/Symbol.pas index b5950f9..8535d55 100644 --- a/Symbol.pas +++ b/Symbol.pas @@ -2040,12 +2040,10 @@ if space <> fieldListSpace then begin {are we defining a function?} if cs^.state = defined then if state = defined then Error(42); + if cs^.itype <> nil then + itype := MakeCompositeType(cs^.itype, itype); p := cs; needSymbol := false; - if not itype^.prototyped then begin - itype^.prototyped := cs^.itype^.prototyped; - itype^.parameterList := cs^.itype^.parameterList; - end; {if} end; {if} end {if} else if (itype <> nil) and (itype^.kind in [structType,unionType]) @@ -2059,6 +2057,9 @@ if space <> fieldListSpace then begin {are we defining a function?} or (globalTable <> table) then if (not doingParameters) or (cs^.state <> declared) then Error(42); + if itype <> nil then + if cs^.itype <> nil then + itype := MakeCompositeType(cs^.itype, itype); p := cs; needSymbol := false; end; {if} @@ -2072,6 +2073,9 @@ if class = staticsy then {statics go in the global symbol table} or ((cs^.state = defined) and (state <> initialized)) or (cs^.state = initialized) then Error(42); + if itype <> nil then + if cs^.itype <> nil then + itype := MakeCompositeType(cs^.itype, itype); p := cs; needSymbol := false; end; {if} diff --git a/cc.notes b/cc.notes index f998f6e..397573a 100644 --- a/cc.notes +++ b/cc.notes @@ -1962,6 +1962,8 @@ int foo(int[42]); 216. Preprocessing directive names could be subject to macro replacement, potentially altering their behavior (e.g. due to a definition like "#define ifdef ifndef"). Now directive names are not expanded as macros, even if there is a macro of the same name. +217. If there were multiple declarations of a variable with internal or external linkage, only the type from the latest declaration would be used, rather than properly forming the composite type from the various declarations. If a global array was first declared with a size specified and subsequently redeclared without a size, this could cause the proper storage not to be allocated for it. + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.