]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Tidy up removing unused procedure, add missing include and error token.
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 5 Dec 2022 17:43:07 +0000 (17:43 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 5 Dec 2022 17:43:07 +0000 (17:43 +0000)
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 <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-compiler/PHBuild.bnf
libgm2/libm2min/libc.c

index 88a7e7a6aeb898918a7ae33aa3c7998f8a55bef4..cbd4a97537447f8c4847855b916681a5b882b282 100644 (file)
@@ -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:
index ad4777ced58e1202839b5678d54d52073d11df66..7cb97421956aadbffce79e6a805cbed25757d96c 100644 (file)
@@ -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 %
                      =:
index 29ef066be8298b0577ae1c0ae76ac4ba977e6b33..2e4f8d3ebab2d0126105aa0da986f8ea14a0080a 100644 (file)
@@ -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
 <http://www.gnu.org/licenses/>.  */
 
-void abort (void) __attribute__ ((noreturn));
-void exit (int) __attribute__ ((noreturn));
+#include <config.h>
+
+#if defined(HAVE_STDLIB_H)
+#include <stdlib.h>
+#endif
 
 void abort (void)
 {