]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR modula2/122009: ODR fixes and prototype correction.
authorGaius Mulley <gaiusmod2@gmail.com>
Sat, 20 Sep 2025 18:40:32 +0000 (19:40 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Sat, 20 Sep 2025 18:40:32 +0000 (19:40 +0100)
This small patch fixes -Wodr warnings and also corrects a prototype.

gcc/m2/ChangeLog:

PR modula2/122009
* gm2-compiler/M2GenGCC.mod (FromM2WIDESETImport): Assign
sym to NulSym.
(CodeMakeAdr): Remove fourth parameter to BuildLogicalOrAddress.
(FoldMakeAdr): Ditto.
* gm2-compiler/M2Quads.mod (BuildAssignmentBoolean): Remove
unused parameter checkTypes.
(doBuildAssignment): Remove checkTypes parameter when calling
BuildAssignmentBoolean.
* gm2-gcc/m2expr.def (BuildLogicalOrAddress): Remove
needconvert parameter.
* gm2-gcc/m2statement.def (IfExprJump): Change label type
to CharStar.
* gm2-gcc/m2type.cc (m2type_BuildEnumerator): Remove const.
* gm2-gcc/m2type.h (m2type_BuildEnumerator): Ditto.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-gcc/m2expr.def
gcc/m2/gm2-gcc/m2statement.def
gcc/m2/gm2-gcc/m2type.cc
gcc/m2/gm2-gcc/m2type.h

index 14a4d5d780be94cf35def027de131a639e124f74..ca1c60316be8b829b2e8539ae100814fb9e4dd34 100644 (file)
@@ -2455,7 +2455,7 @@ BEGIN
                tmp := BuildLSL (location, tmp, bits, FALSE)
             END ;
             bits := BuildAdd (location, bits, GetSizeOfInBits (Mod2Gcc (type)), FALSE) ;
-            val := BuildLogicalOrAddress (location, val, tmp, FALSE)
+            val := BuildLogicalOrAddress (location, val, tmp)
          END
       END ;
       SubQuad (n) ;
@@ -2548,7 +2548,7 @@ BEGIN
                   tmp := BuildLSL (location, tmp, bits, FALSE)
                END ;
               bits := BuildAdd (location, bits, GetSizeOfInBits (Mod2Gcc (type)), FALSE) ;
-               val := BuildLogicalOrAddress (location, val, tmp, FALSE)
+               val := BuildLogicalOrAddress (location, val, tmp)
             END
          END ;
          SubQuad (n) ;
@@ -5762,6 +5762,7 @@ PROCEDURE FromM2WIDESETImport (tokenno: CARDINAL; name: Name) : CARDINAL ;
 VAR
    sym, module: CARDINAL ;
 BEGIN
+   sym := NulSym ;
    IF GetWideset ()
    THEN
       module := MakeDefinitionSource (tokenno, MakeKey ("M2WIDESET")) ;
index 9489bd8d114bd524d4789ed5324865c1aa637eaa..ae7dde0f9b235f9a5c6353b20f2873a0f2b807a5 100644 (file)
@@ -3836,7 +3836,7 @@ END BuildAssignConstant ;
                             A variable maybe an L value so it will require dereferencing.
 *)
 
-PROCEDURE BuildAssignmentBoolean (becomesTokNo: CARDINAL; checkTypes, checkOverflow: BOOLEAN;
+PROCEDURE BuildAssignmentBoolean (becomesTokNo: CARDINAL; checkOverflow: BOOLEAN;
                                   t, f: CARDINAL; Des: CARDINAL; destok: CARDINAL) ;
 BEGIN
       PutVarConditional (Des, TRUE) ;  (* Des will contain the result of a boolean relop.  *)
@@ -3885,7 +3885,7 @@ BEGIN
       PopTtok (Des, destok) ;
       IF IsVar (Des) OR IsConstVar (Des)
       THEN
-         BuildAssignmentBoolean (becomesTokNo, checkTypes, checkOverflow,
+         BuildAssignmentBoolean (becomesTokNo, checkOverflow,
                                  t, f, Des, destok)
       ELSE
          MetaErrorT1 (destok, 'expecting the designator {%1Ead} to be a constant or a variable and not a {%1dv}', Des)
index 6842724ef8c3d4b2c439c20d4c7d43ac18470d47..722a3c9ef7e438c8595535768bd816f66bdc0a8a 100644 (file)
@@ -417,7 +417,7 @@ PROCEDURE BuildOffset (location: location_t; record: tree; field: tree; needconv
     BuildLogicalOrAddress - build a logical or expressions and return the tree.
 *)
 
-PROCEDURE BuildLogicalOrAddress (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ;
+PROCEDURE BuildLogicalOrAddress (location: location_t; op1: tree; op2: tree) : tree ;
 
 
 (*
index fbb578f40aa6d331996b05aee83e5bbb99435826..e96005dcf4a9656dcc32954a7974677e8456bc9d 100644 (file)
@@ -31,7 +31,7 @@ FROM SYSTEM IMPORT ADDRESS ;
    IfExprJump - if expr then jump to the label.
 *)
 
-PROCEDURE IfExprJump (location: location_t; exp: tree; label: ADDRESS) ;
+PROCEDURE IfExprJump (location: location_t; exp: tree; label: CharStar) ;
 
 
 (*
index 184b506aa6932103c7d972fda573d87b729e1ca6..535ab143053f5d8be771d177963655ef5c7a5b39 100644 (file)
@@ -2213,7 +2213,7 @@ gm2_build_enumerator (location_t location, tree name, tree value)
    enumvalues, list.  It returns a copy of the value.  */
 
 tree
-m2type_BuildEnumerator (location_t location, const char *name, tree value,
+m2type_BuildEnumerator (location_t location, char *name, tree value,
                         tree *enumvalues)
 {
   tree id = get_identifier (name);
index 68015a01e1452f31606d3c673306b11c71611294..afd97f763143738aeb37677cb0a0ebb6c0cf8ca4 100644 (file)
@@ -183,7 +183,7 @@ EXTERN tree m2type_BuildStartEnumeration (location_t location, char *name,
                                           bool ispacked);
 EXTERN tree m2type_BuildEndEnumeration (location_t location, tree enumtype,
                                         tree enumvalues);
-EXTERN tree m2type_BuildEnumerator (location_t location, const char *name,
+EXTERN tree m2type_BuildEnumerator (location_t location, char *name,
                                     tree value, tree *enumvalues);
 EXTERN tree m2type_BuildPointerType (tree totype);
 EXTERN tree m2type_BuildConstPointerType (tree totype);