This is a followup patch for PR modula2/121164 to fix the location for the error message attributed to cc1gm2. The Patch has been cherry picked, but without the forced -Wall option in libgm2.
gcc/m2/ChangeLog: PR modula2/121164 * gm2-compiler/P1SymBuild.mod: Remove PutProcTypeParam. Remove PutProcTypeParam. (CheckFileName): Remove. (P1EndBuildDefinitionModule): Correct spelling. (P1EndBuildImplementationModule): Ditto. (P1EndBuildProgramModule): Ditto. (EndBuildInnerModule): Ditto. * gm2-compiler/P2SymBuild.mod (P2EndBuildDefModule): Correct spelling. (P2EndBuildImplementationModule): Ditto. (P2EndBuildProgramModule): Ditto. (EndBuildInnerModule): Ditto. (CheckFormalParameterSection): Ditto. * gm2-compiler/P3SymBuild.mod (P3EndBuildDefModule): Ditto. * gm2-compiler/PCSymBuild.mod (PCEndBuildDefModule): Ditto. (fixupProcedureType): Pass tok to PutProcTypeVarParam. Pass tok to PutProcTypeParam. * gm2-compiler/SymbolTable.def (PutProcTypeParam): Add tok parameter. (PutProcTypeVarParam): Ditto. * gm2-compiler/SymbolTable.mod (SymParam): At change type to CARDINAL. New field FullTok. New field Scope. (SymVarParam): At change type to CARDINAL. New field FullTok. New field Scope. (GetVarDeclTok): Check ShadowVar for NulSym and return At. (PutParam): Initialize FullTok. Initialize At. Initialize Scope. (PutVarParam): Initialize FullTok. Assign At. Initialize Scope. (AddProcedureProcTypeParam): Add tok parameter. (GetScope): Add ParamSym and VarParamSym clause. (PutProcTypeVarParam): Add tok parameter. Initialize At. Initialize FullTok. (GetDeclaredDefinition): Clause ParamSym return At. Clause VarParamSym return At. (GetDeclaredModule): Ditto. (PutDeclaredDefinition): Remove clause ParamSym. Remove clause VarParamSym. (PutDeclaredModule): Remove clause ParamSym. Remove clause VarParamSym. gcc/testsuite/ChangeLog: PR modula2/121164 * gm2/switches/pedantic-params/fail/arrayofchar.def: New test. * gm2/switches/pedantic-params/fail/arrayofchar.mod: New test. (cherry picked from commit ab5a89c0b4f1ead202dee072e16690607b810111) Signed-off-by: Gaius Mulley <gaiusm...@gmail.com> --- gcc/m2/gm2-compiler/P1SymBuild.mod | 45 +--------- gcc/m2/gm2-compiler/P2SymBuild.mod | 26 +++--- gcc/m2/gm2-compiler/P3SymBuild.mod | 2 +- gcc/m2/gm2-compiler/PCSymBuild.mod | 6 +- gcc/m2/gm2-compiler/SymbolTable.def | 6 +- gcc/m2/gm2-compiler/SymbolTable.mod | 87 +++++++++++-------- .../pedantic-params/fail/arrayofchar.def | 12 +++ .../pedantic-params/fail/arrayofchar.mod | 30 +++++++ 8 files changed, 117 insertions(+), 97 deletions(-) create mode 100644 gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.def create mode 100644 gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.mod diff --git a/gcc/m2/gm2-compiler/P1SymBuild.mod b/gcc/m2/gm2-compiler/P1SymBuild.mod index 02d4ac7f751..08a0fc3f9eb 100644 --- a/gcc/m2/gm2-compiler/P1SymBuild.mod +++ b/gcc/m2/gm2-compiler/P1SymBuild.mod @@ -79,7 +79,6 @@ FROM SymbolTable IMPORT NulSym, MakeSubscript, PutSubscript, PutArray, GetType, IsArray, IsProcType, MakeProcType, - PutProcTypeVarParam, PutProcTypeParam, PutProcedureBuiltin, PutProcedureInline, GetSymName, ResolveImports, PutDeclared, @@ -108,42 +107,6 @@ VAR importStatementCount: CARDINAL ; -(* - CheckFileName - checks to see that the module name matches the file name. -*) - -(* -PROCEDURE CheckFileName (tok: CARDINAL; name: Name; ModuleType: ARRAY OF CHAR) ; -VAR - ext, - basename: INTEGER ; - s, - FileName: String ; -BEGIN - FileName := GetFileName() ; - basename := RIndex(FileName, '/', 0) ; - IF basename=-1 - THEN - basename := 0 - END ; - ext := RIndex(FileName, '.', 0) ; - IF ext=-1 - THEN - ext := 0 - END ; - FileName := Slice(FileName, basename, ext) ; - IF EqualCharStar(FileName, KeyToCharStar(name)) - THEN - FileName := KillString(FileName) - ELSE - s := ConCat (InitString (ModuleType), - Mark (InitString (" module name {%1Ea} is inconsistant with the filename {%F{%2a}}"))) ; - MetaErrorString2 (s, MakeError (tok, name), MakeErrorS (tok, FileName)) - END -END CheckFileName ; -*) - - (* StartBuildDefinitionModule - Creates a definition module and starts a new scope. @@ -227,7 +190,7 @@ BEGIN END ; IF NameStart#NameEnd THEN - MetaError1 ('inconsistant definition module name {%1Wa}', MakeError (start, NameStart)) + MetaError1 ('inconsistent definition module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END P1EndBuildDefinitionModule ; @@ -301,7 +264,7 @@ BEGIN IF NameStart#NameEnd THEN MetaErrorT1 (end, - 'inconsistant implementation module name {%1Wa}', MakeError (start, NameStart)) + 'inconsistent implementation module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END P1EndBuildImplementationModule ; @@ -381,7 +344,7 @@ BEGIN IF NameStart#NameEnd THEN MetaErrorT1 (end, - 'inconsistant program module name {%1Wa}', MakeError (start, NameStart)) + 'inconsistent program module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END P1EndBuildProgramModule ; @@ -446,7 +409,7 @@ BEGIN IF NameStart#NameEnd THEN MetaErrorT1 (end, - 'inconsistant inner module name {%1Wa}', MakeError (start, NameStart)) + 'inconsistent inner module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END EndBuildInnerModule ; diff --git a/gcc/m2/gm2-compiler/P2SymBuild.mod b/gcc/m2/gm2-compiler/P2SymBuild.mod index 5c82ec8ede0..3bb3e4741d2 100644 --- a/gcc/m2/gm2-compiler/P2SymBuild.mod +++ b/gcc/m2/gm2-compiler/P2SymBuild.mod @@ -356,7 +356,7 @@ BEGIN END ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant definition module name, module began as (%a) and ended with (%a)', NameStart, NameEnd) + WriteFormat2('inconsistent definition module name, module began as (%a) and ended with (%a)', NameStart, NameEnd) END ; M2Error.LeaveErrorScope END P2EndBuildDefModule ; @@ -425,7 +425,7 @@ BEGIN PopT (NameEnd) ; IF NameStart#NameEnd THEN - WriteFormat1('inconsistant implementation module name %a', NameStart) + WriteFormat1('inconsistent implementation module name %a', NameStart) END ; M2Error.LeaveErrorScope END P2EndBuildImplementationModule ; @@ -499,7 +499,7 @@ BEGIN END ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant program module name %a does not match %a', NameStart, NameEnd) + WriteFormat2('inconsistent program module name %a does not match %a', NameStart, NameEnd) END ; M2Error.LeaveErrorScope END P2EndBuildProgramModule ; @@ -564,7 +564,7 @@ BEGIN PopT(NameEnd) ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant inner module name %a does not match %a', + WriteFormat2('inconsistent inner module name %a does not match %a', NameStart, NameEnd) END ; M2Error.LeaveErrorScope @@ -1835,13 +1835,13 @@ BEGIN (* WarnStringAt (InitString ('parampos?'), OperandTok (pi)) ; *) IF Unbounded AND (NOT IsUnboundedParam (ProcSym, prevkind, ParamTotal+i)) THEN - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the parameter {%3EHa} was not declared as an ARRAY OF type', 'the parameter {%3EVa} was declared as an ARRAY OF type', ParamTotal+i, ProcSym, curkind, prevkind) ELSIF (NOT Unbounded) AND IsUnboundedParam (ProcSym, prevkind, ParamTotal+i) THEN - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the parameter {%3EHa} was declared as an ARRAY OF type', 'the parameter {%3EVa} was not declared as an ARRAY OF type', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1850,7 +1850,7 @@ BEGIN THEN IF GetDimension (GetNthParam (ProcSym, prevkind, ParamTotal+1)) # ndim THEN - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the dynamic array parameter {%3EHa} was declared with a different of dimensions', 'the dynamic array parameter {%3EVa} was declared with a different of dimensions', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1859,14 +1859,14 @@ BEGIN IF isVarParam AND (NOT IsVarParam (ProcSym, prevkind, ParamTotal+i)) THEN (* Expecting non VAR parameter. *) - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', '{%3EHa} was not declared as a {%kVAR} parameter', '{%3EVa} was declared as a {%kVAR} parameter', ParamTotal+i, ProcSym, curkind, prevkind) ELSIF (NOT isVarParam) AND IsVarParam (ProcSym, prevkind, ParamTotal+i) THEN (* Expecting VAR pamarater. *) - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', '{%3EHa} was declared as a {%kVAR} parameter', '{%3EVa} was not declared as a {%kVAR} parameter', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1877,7 +1877,7 @@ BEGIN IF GetSymName (ParamI) # OperandT (pi) THEN (* Different parameter names. *) - ParameterError ('procedure {%%1a} in the %s differs from the %s, {%%2N} parameter name is inconsistant, %s', + ParameterError ('procedure {%%1a} in the %s differs from the %s, {%%2N} parameter name is inconsistent, %s', 'named as {%3EVa}', 'named as {%3EVa}', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1897,7 +1897,7 @@ BEGIN (NOT IsUnknown(SkipType(ParamIType))) THEN (* Different parameter types. *) - ParameterError ('declaration in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the parameter {%3EHa} was declared with a different type', 'the parameter {%3EVa} was declared with a different type', ParamTotal+i, ProcSym, curkind, prevkind) @@ -3072,10 +3072,10 @@ BEGIN IF Var=VarTok THEN (* VAR parameter *) - PutProcTypeVarParam(ProcTypeSym, TypeSym, IsUnbounded(TypeSym)) + PutProcTypeVarParam (tok, ProcTypeSym, TypeSym, IsUnbounded (TypeSym)) ELSE (* Non VAR parameter *) - PutProcTypeParam(ProcTypeSym, TypeSym, IsUnbounded(TypeSym)) + PutProcTypeParam (tok, ProcTypeSym, TypeSym, IsUnbounded (TypeSym)) END ; PushT(ProcTypeSym) ; Annotate("%1s(%1d)||proc type") diff --git a/gcc/m2/gm2-compiler/P3SymBuild.mod b/gcc/m2/gm2-compiler/P3SymBuild.mod index c4877f732e5..096057eb497 100644 --- a/gcc/m2/gm2-compiler/P3SymBuild.mod +++ b/gcc/m2/gm2-compiler/P3SymBuild.mod @@ -126,7 +126,7 @@ BEGIN PopT(NameStart) ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant definition module was named (%a) and concluded as (%a)', + WriteFormat2('inconsistent definition module was named (%a) and concluded as (%a)', NameStart, NameEnd) END ; M2Error.LeaveErrorScope diff --git a/gcc/m2/gm2-compiler/PCSymBuild.mod b/gcc/m2/gm2-compiler/PCSymBuild.mod index 3bffe8674a4..4db2730ce5c 100644 --- a/gcc/m2/gm2-compiler/PCSymBuild.mod +++ b/gcc/m2/gm2-compiler/PCSymBuild.mod @@ -269,7 +269,7 @@ BEGIN PopT(NameStart) ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant definition module was named (%a) and concluded as (%a)', + WriteFormat2('inconsistent definition module was named (%a) and concluded as (%a)', NameStart, NameEnd) END ; M2Error.LeaveErrorScope @@ -1168,9 +1168,9 @@ BEGIN par := GetParam (p, i) ; IF IsParameterVar (par) THEN - PutProcTypeVarParam (t, GetType (par), IsParameterUnbounded (par)) + PutProcTypeVarParam (tok, t, GetType (par), IsParameterUnbounded (par)) ELSE - PutProcTypeParam (t, GetType (par), IsParameterUnbounded (par)) + PutProcTypeParam (tok, t, GetType (par), IsParameterUnbounded (par)) END ; INC(i) END ; diff --git a/gcc/m2/gm2-compiler/SymbolTable.def b/gcc/m2/gm2-compiler/SymbolTable.def index 2a9865add94..5b93f292381 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.def +++ b/gcc/m2/gm2-compiler/SymbolTable.def @@ -2650,7 +2650,8 @@ PROCEDURE MakeProcType (tok: CARDINAL; ProcTypeName: Name) : CARDINAL ; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeParam (Sym: CARDINAL; +PROCEDURE PutProcTypeParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; @@ -2659,7 +2660,8 @@ PROCEDURE PutProcTypeParam (Sym: CARDINAL; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeVarParam (Sym: CARDINAL; +PROCEDURE PutProcTypeVarParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index ff661dcf4e7..00946e52b2e 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -463,9 +463,11 @@ TYPE (* of param. *) Type : CARDINAL ; (* Index to the type of param. *) IsUnbounded : BOOLEAN ; (* Is it an ARRAY OF Type? *) + Scope : CARDINAL ; (* Procedure declaration. *) ShadowVar : CARDINAL ; (* The local variable used to *) (* shadow this parameter. *) - At : Where ; (* Where was sym declared/used *) + FullTok, (* name: type virtual token. *) + At : CARDINAL ; (* Where was sym declared. *) END ; SymVarParam = RECORD @@ -476,9 +478,11 @@ TYPE HeapVar : CARDINAL ;(* The pointer value on heap. *) (* Only used by static *) (* analysis. *) + Scope : CARDINAL ;(* Procedure declaration. *) ShadowVar : CARDINAL ;(* The local variable used to *) (* shadow this parameter. *) - At : Where ; (* Where was sym declared/used *) + FullTok, (* name: type virtual token. *) + At : CARDINAL ;(* Where was sym declared. *) END ; ConstStringVariant = (m2str, cstr, m2nulstr, cnulstr) ; @@ -4456,9 +4460,19 @@ BEGIN pSym := GetPsym (sym) ; IF IsParameterVar (sym) THEN - RETURN GetVarDeclTok (pSym^.VarParam.ShadowVar) + IF pSym^.VarParam.ShadowVar = NulSym + THEN + RETURN pSym^.VarParam.At + ELSE + RETURN GetVarDeclTok (pSym^.VarParam.ShadowVar) + END ELSE - RETURN GetVarDeclTok (pSym^.Param.ShadowVar) + IF pSym^.Param.ShadowVar = NulSym + THEN + RETURN pSym^.Param.At + ELSE + RETURN GetVarDeclTok (pSym^.Param.ShadowVar) + END END ELSIF IsVar (sym) THEN @@ -4549,9 +4563,9 @@ BEGIN THEN IF IsParameterVar (sym) THEN - RETURN GetVarDeclFullTok (pSym^.VarParam.ShadowVar) + RETURN pSym^.VarParam.FullTok ELSE - RETURN GetVarDeclFullTok (pSym^.Param.ShadowVar) + RETURN pSym^.Param.FullTok END ELSIF IsVar (sym) THEN @@ -10651,8 +10665,10 @@ BEGIN name := ParamName ; Type := ParamType ; IsUnbounded := isUnbounded ; + Scope := Sym ; ShadowVar := NulSym ; - InitWhereDeclaredTok(tok, At) + FullTok := MakeVirtual2Tok (tok, typetok) ; + At := tok END END ; AddParameter (Sym, kind, ParSym) ; @@ -10671,7 +10687,7 @@ BEGIN pSym^.Param.ShadowVar := VariableSym END END ; - AddProcedureProcTypeParam (Sym, ParamType, isUnbounded, FALSE) + AddProcedureProcTypeParam (tok, Sym, ParamType, isUnbounded, FALSE) END ; RETURN( TRUE ) END PutParam ; @@ -10708,9 +10724,11 @@ BEGIN name := ParamName ; Type := ParamType ; IsUnbounded := isUnbounded ; + Scope := Sym ; ShadowVar := NulSym ; HeapVar := NulSym ; (* Will contain a pointer value. *) - InitWhereDeclaredTok(tok, At) + FullTok := MakeVirtual2Tok (tok, typetok) ; + At := tok END END ; AddParameter (Sym, kind, ParSym) ; @@ -10729,7 +10747,7 @@ BEGIN pSym^.VarParam.ShadowVar := VariableSym END END ; - AddProcedureProcTypeParam (Sym, ParamType, isUnbounded, TRUE) + AddProcedureProcTypeParam (tok, Sym, ParamType, isUnbounded, TRUE) END ; RETURN( TRUE ) END PutVarParam ; @@ -10816,7 +10834,8 @@ END AddParameter ; associated with procedure Sym. *) -PROCEDURE AddProcedureProcTypeParam (Sym, ParamType: CARDINAL; +PROCEDURE AddProcedureProcTypeParam (tok: CARDINAL; + Sym, ParamType: CARDINAL; isUnbounded, isVarParam: BOOLEAN) ; VAR pSym: PtrToSymbol ; @@ -10829,10 +10848,12 @@ BEGIN THEN IF isVarParam THEN - PutProcTypeVarParam (Procedure.ProcedureType, + PutProcTypeVarParam (tok, + Procedure.ProcedureType, ParamType, isUnbounded) ELSE - PutProcTypeParam (Procedure.ProcedureType, + PutProcTypeParam (tok, + Procedure.ProcedureType, ParamType, isUnbounded) END END @@ -13027,18 +13048,8 @@ BEGIN ConstLitSym : RETURN( ConstLit.Scope ) | ConstStringSym : RETURN( ConstString.Scope ) | ConstVarSym : RETURN( ConstVar.Scope ) | - ParamSym : IF Param.ShadowVar = NulSym - THEN - RETURN NulSym - ELSE - RETURN( GetScope (Param.ShadowVar) ) - END | - VarParamSym : IF VarParam.ShadowVar = NulSym - THEN - RETURN NulSym - ELSE - RETURN( GetScope (VarParam.ShadowVar) ) - END | + ParamSym : RETURN( Param.Scope ) | + VarParamSym : RETURN( VarParam.Scope ) | UndefinedSym : RETURN( NulSym ) | PartialUnboundedSym: InternalError ('should not be requesting the scope of a PartialUnbounded symbol') @@ -13186,7 +13197,8 @@ END MakeProcType ; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeParam (Sym: CARDINAL; +PROCEDURE PutProcTypeParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; VAR pSym : PtrToSymbol ; @@ -13201,7 +13213,8 @@ BEGIN Type := ParamType ; IsUnbounded := isUnbounded ; ShadowVar := NulSym ; - InitWhereDeclared(At) + FullTok := tok ; + At := tok END END ; AddParameter (Sym, ProperProcedure, ParSym) @@ -13213,7 +13226,8 @@ END PutProcTypeParam ; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeVarParam (Sym: CARDINAL; +PROCEDURE PutProcTypeVarParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; VAR pSym : PtrToSymbol ; @@ -13228,7 +13242,8 @@ BEGIN Type := ParamType ; IsUnbounded := isUnbounded ; ShadowVar := NulSym ; - InitWhereDeclared(At) + FullTok := tok ; + At := tok END END ; AddParameter (Sym, ProperProcedure, ParSym) @@ -13918,8 +13933,8 @@ BEGIN UnboundedSym : RETURN( Unbounded.At.DefDeclared ) | ProcedureSym : RETURN( Procedure.At.DefDeclared ) | ProcTypeSym : RETURN( ProcType.At.DefDeclared ) | - ParamSym : RETURN( Param.At.DefDeclared ) | - VarParamSym : RETURN( VarParam.At.DefDeclared ) | + ParamSym : RETURN( Param.At ) | + VarParamSym : RETURN( VarParam.At ) | ConstStringSym : RETURN( ConstString.At.DefDeclared ) | ConstLitSym : RETURN( ConstLit.At.DefDeclared ) | ConstVarSym : RETURN( ConstVar.At.DefDeclared ) | @@ -13968,8 +13983,8 @@ BEGIN UnboundedSym : RETURN( Unbounded.At.ModDeclared ) | ProcedureSym : RETURN( Procedure.At.ModDeclared ) | ProcTypeSym : RETURN( ProcType.At.ModDeclared ) | - ParamSym : RETURN( Param.At.ModDeclared ) | - VarParamSym : RETURN( VarParam.At.ModDeclared ) | + ParamSym : RETURN( Param.At ) | + VarParamSym : RETURN( VarParam.At ) | ConstStringSym : RETURN( ConstString.At.ModDeclared ) | ConstLitSym : RETURN( ConstLit.At.ModDeclared ) | ConstVarSym : RETURN( ConstVar.At.ModDeclared ) | @@ -14019,8 +14034,6 @@ BEGIN UnboundedSym : Unbounded.At.DefDeclared := tok | ProcedureSym : Procedure.At.DefDeclared := tok | ProcTypeSym : ProcType.At.DefDeclared := tok | - ParamSym : Param.At.DefDeclared := tok | - VarParamSym : VarParam.At.DefDeclared := tok | ConstStringSym : ConstString.At.DefDeclared := tok | ConstLitSym : ConstLit.At.DefDeclared := tok | ConstVarSym : ConstVar.At.DefDeclared := tok | @@ -14067,8 +14080,6 @@ BEGIN UnboundedSym : Unbounded.At.ModDeclared := tok | ProcedureSym : Procedure.At.ModDeclared := tok | ProcTypeSym : ProcType.At.ModDeclared := tok | - ParamSym : Param.At.ModDeclared := tok | - VarParamSym : VarParam.At.ModDeclared := tok | ConstStringSym : ConstString.At.ModDeclared := tok | ConstLitSym : ConstLit.At.ModDeclared := tok | ConstVarSym : ConstVar.At.ModDeclared := tok | @@ -14323,8 +14334,10 @@ BEGIN UnboundedSym : RETURN( Unbounded.At.FirstUsed ) | ProcedureSym : RETURN( Procedure.At.FirstUsed ) | ProcTypeSym : RETURN( ProcType.At.FirstUsed ) | + (* ParamSym : RETURN( Param.At.FirstUsed ) | VarParamSym : RETURN( VarParam.At.FirstUsed ) | + *) ConstStringSym : RETURN( ConstString.At.FirstUsed ) | ConstLitSym : RETURN( ConstLit.At.FirstUsed ) | ConstVarSym : RETURN( ConstVar.At.FirstUsed ) | diff --git a/gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.def b/gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.def new file mode 100644 index 00000000000..a24f7d370ff --- /dev/null +++ b/gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.def @@ -0,0 +1,12 @@ +DEFINITION MODULE arrayofchar ; + +FROM FIO IMPORT File ; + +(* + Description: provides write procedures for ARRAY OF CHAR. +*) + +PROCEDURE Write (f: File; str: ARRAY OF CHAR) ; +PROCEDURE WriteLn (f: File) ; + +END arrayofchar. diff --git a/gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.mod b/gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.mod new file mode 100644 index 00000000000..4e630a985ee --- /dev/null +++ b/gcc/testsuite/gm2/switches/pedantic-params/fail/arrayofchar.mod @@ -0,0 +1,30 @@ +IMPLEMENTATION MODULE arrayofchar ; + +FROM FIO IMPORT WriteChar, WriteLine ; +IMPORT StrLib ; + + +(* + Write - writes a string to file f. +*) + +PROCEDURE Write (f: File; a: ARRAY OF CHAR) ; +VAR + len, i: CARDINAL ; +BEGIN + len := StrLib.StrLen (a) ; + i := 0 ; + WHILE i < len DO + WriteChar (f, a[i]) ; + INC (i) + END +END Write ; + + +PROCEDURE WriteLn (f: File) ; +BEGIN + WriteLine (f) +END WriteLn ; + + +END arrayofchar. -- 2.39.5