From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id 3FBBA394343C; Mon, 5 Dec 2022 17:44:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FBBA394343C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670262240; bh=RNi7MoK4t+p8uRN3e+bMcoTI63bJAAj/x9Xjf+z6JCY=; h=From:To:Subject:Date:From; b=gD1s1P3e+vvJUKuJHWiSQMvgFX5T1yQgAs765ExJbDZECQiOLW1TdrRgAW2058kLL X3SKNtj5GdqM9yd+kteU4KOyb3WTh0PVpTYFnFwbEpFukDgR1jy7EOixb6QSJED1tY r12vqNELJXWiXZz8cyIOgKnPREAKoGCiz5SiINOs= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] Tidy up removing unused procedure, add missing include and error token. X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/devel/modula-2 X-Git-Oldrev: 14e295ecf043c7bdf26cca3aa6af104382324aeb X-Git-Newrev: 60035bdefe5241548b41c3ac236b1c9feb9bf182 Message-Id: <20221205174400.3FBBA394343C@sourceware.org> Date: Mon, 5 Dec 2022 17:44:00 +0000 (GMT) List-Id: https://gcc.gnu.org/g:60035bdefe5241548b41c3ac236b1c9feb9bf182 commit 60035bdefe5241548b41c3ac236b1c9feb9bf182 Author: Gaius Mulley Date: Mon Dec 5 17:43:07 2022 +0000 Tidy up removing unused procedure, add missing include and error token. Some minor tidy ups which remove an unused procedure, add a missing include header file and use a different token for the production of error messages. libgm2/ChangeLog: * libgm2/libm2min/libc.c: Add include stdlib.h. gcc/m2/ChangeLog: * gm2-compiler/M2Quads.mod (CheckInCompatible): Removed usused procedure. (CheckVariableOrConstantOrProcedure) use destok when generating an error about the designator. * gm2-compiler/PHBuild.bnf (ModuleDeclaration): Remove unused variable endt. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Quads.mod | 24 +----------------------- gcc/m2/gm2-compiler/PHBuild.bnf | 3 +-- libgm2/libm2min/libc.c | 7 +++++-- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 88a7e7a6aeb..cbd4a975374 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -3552,7 +3552,7 @@ BEGIN ((DesT#NulSym) AND (NOT IsProcType(DesT))) AND ((DesL#NulSym) AND (NOT IsProcType(DesL))) THEN - MetaErrorT1 (combinedtok, + MetaErrorT1 (destok, 'incorrectly assigning a procedure to a designator {%1Ead} (designator is not a procedure type, {%1ast})', Des) ELSIF IsProcedure (Exp) AND IsProcedureNested (Exp) THEN @@ -12765,28 +12765,6 @@ BEGIN END CheckVariableOrConstantOrProcedure ; -(* - CheckInCompatible - checks to see that t1 IN t2 is type legal. -*) - -PROCEDURE CheckInCompatible (Op: Name; t1, t2: CARDINAL) : CARDINAL ; -BEGIN - IF Op = InTok - THEN - t2 := SkipType (t2) ; - IF IsSet (t2) - THEN - RETURN GetSType (t2) - ELSE - MetaError1 ('expect a set type as the right hand operand to the {%kIN} operator, the type attempting to be used with the {%kIN} is {%1Ead}', t2) ; - RETURN t1 - END - ELSE - RETURN t2 - END -END CheckInCompatible ; - - (* BuildRelOp - Builds a relative operation from the quad stack. The Stack is expected to contain: diff --git a/gcc/m2/gm2-compiler/PHBuild.bnf b/gcc/m2/gm2-compiler/PHBuild.bnf index ad4777ced58..7cb97421956 100644 --- a/gcc/m2/gm2-compiler/PHBuild.bnf +++ b/gcc/m2/gm2-compiler/PHBuild.bnf @@ -1188,7 +1188,7 @@ DefOptArg := "[" Ident ":" FormalType "=" SilentConstExpression "]" =: FormalType := { "ARRAY" "OF" } Qualident =: -ModuleDeclaration := % VAR begint, endt: CARDINAL ; % +ModuleDeclaration := % VAR begint: CARDINAL ; % % begint := GetTokenNo () % "MODULE" % M2Error.DefaultInnerModule % % PushAutoOn % @@ -1201,7 +1201,6 @@ ModuleDeclaration := % VAR } [ Export ] Block % PushAutoOn % - % endt := GetTokenNo () -1 % Ident % EndBuildInnerModule % % PopAuto ; PopAuto ; PopAuto % =: diff --git a/libgm2/libm2min/libc.c b/libgm2/libm2min/libc.c index 29ef066be82..2e4f8d3ebab 100644 --- a/libgm2/libm2min/libc.c +++ b/libgm2/libm2min/libc.c @@ -24,8 +24,11 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -void abort (void) __attribute__ ((noreturn)); -void exit (int) __attribute__ ((noreturn)); +#include + +#if defined(HAVE_STDLIB_H) +#include +#endif void abort (void) {