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>
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) ;
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) ;
VAR
sym, module: CARDINAL ;
BEGIN
+ sym := NulSym ;
IF GetWideset ()
THEN
module := MakeDefinitionSource (tokenno, MakeKey ("M2WIDESET")) ;
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. *)
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)
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 ;
(*
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) ;
(*
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);
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);