Warning fixes:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Mon, 22 Jun 1998 05:23:33 +0000 (05:23 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Mon, 22 Jun 1998 05:23:33 +0000 (05:23 +0000)
        * Makefile.in (varasm.o): Depend on sdbout.h.
        (sdbout.o): Depend on toplev.h.
        * collect2.c (scan_prog_file): Cast fprintf argument to `long' and
        use %ld specifier.
        * final.c (shorten_branches): Cast first arg of `bzero' to char *.
        * genextract.c (main): When creating insn-extract.c, mark variable
        `i' with ATTRIBUTE_UNUSED.
        * genpeep.c (main): When creating insn-peep.c, mark variables
        `insn', `x' and `pat' with ATTRIBUTE_UNUSED.
        * objc/init.c (__objc_tree_print): Wrap function definition in
        macro `DEBUG'.
        * objc/objc-act.c (encode_array): Cast sprintf argument to `long'
        and use %ld specifier.
        (adorn_decl): Likewise, twice.

From-SVN: r20650

gcc/ChangeLog
gcc/Makefile.in
gcc/collect2.c
gcc/final.c
gcc/genextract.c
gcc/genpeep.c
gcc/objc/init.c
gcc/objc/objc-act.c

index 6815148997750541e5403aa939ff3d469f386324..9484006f0ddbb2386fba161597bce0cf413eb0ac 100644 (file)
@@ -1,3 +1,26 @@
+Mon Jun 22 08:18:46 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * Makefile.in (varasm.o): Depend on sdbout.h.
+       (sdbout.o): Depend on toplev.h.
+
+       * collect2.c (scan_prog_file): Cast fprintf argument to `long' and
+       use %ld specifier.
+
+       * final.c (shorten_branches): Cast first arg of `bzero' to char *.
+
+       * genextract.c (main): When creating insn-extract.c, mark variable
+       `i' with ATTRIBUTE_UNUSED.
+
+       * genpeep.c (main): When creating insn-peep.c, mark variables
+       `insn', `x' and `pat' with ATTRIBUTE_UNUSED.
+
+       * objc/init.c (__objc_tree_print): Wrap function definition in
+       macro `DEBUG'.
+
+       * objc/objc-act.c (encode_array): Cast sprintf argument to `long'
+       and use %ld specifier.
+       (adorn_decl): Likewise, twice.
+
 Sun Jun 21 17:05:34 1998  Dave Love  <d.love@dl.ac.uk>
 
        * Makefile.in (install-info): Use install-info program if
index 819bccc4cc3a6277b3446a38722b402c2a5a9aec..1ab4d0d465d3427280b5e137959b66bddc23203f 100644 (file)
@@ -1372,7 +1372,7 @@ rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
 
 varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
    function.h defaults.h insn-codes.h expr.h hard-reg-set.h regs.h \
-   xcoffout.h output.h c-pragma.h toplev.h except.h dbxout.h
+   xcoffout.h output.h c-pragma.h toplev.h except.h dbxout.h sdbout.h
 function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
    function.h insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h \
    insn-config.h $(RECOG_H) output.h toplev.h except.h
@@ -1398,7 +1398,7 @@ dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h regs.h \
    toplev.h
 sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
    function.h expr.h output.h hard-reg-set.h regs.h defaults.h real.h \
-   insn-config.h obstack.h xcoffout.h c-pragma.h sdbout.h insn-codes.h
+   insn-config.h obstack.h xcoffout.h c-pragma.h sdbout.h insn-codes.h toplev.h
 dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
    flags.h insn-config.h reload.h output.h defaults.h toplev.h dwarfout.h
 dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
index eec7a95e10cceb395fe8c100399cba0400de0c9f..6c4933debe3bb49263f1582ba783b520fdb8ad1a 100644 (file)
@@ -2828,8 +2828,8 @@ scan_prog_file (prog_name, which_pass)
 #else
                      if (debug)
                        fprintf (stderr,
-                                "\tiss = %5d, value = %5d, index = %5d, name = %s\n",
-                                symbol.iss, symbol.value, symbol.index, name);
+                                "\tiss = %5d, value = %5ld, index = %5d, name = %s\n",
+                                symbol.iss, (long) symbol.value, symbol.index, name);
 #endif
                    }
 #ifdef COLLECT_EXPORT_LIST
index 79990bc2356f018d5bea713c8bf96bbcbaf3a5be..ca6c22037d8720aa03d8535cd695807ea592acdc 100644 (file)
@@ -1028,7 +1028,7 @@ shorten_branches (first)
   min_labelno = get_first_label_num ();
   label_align = (struct label_alignment *) xmalloc (
     (max_labelno - min_labelno + 1) * sizeof (struct label_alignment));
-  bzero (label_align,
+  bzero ((char *) label_align,
     (max_labelno - min_labelno + 1) * sizeof (struct label_alignment));
 
   uid_shuid = (int *) xmalloc (max_uid * sizeof *uid_shuid);
index 295243d2010ea3b5131759ce081492bebc6790eb..c06a74ca639df697699218b1f8af3a038e8d4c17 100644 (file)
@@ -480,7 +480,7 @@ from the machine description file `md'.  */\n\n");
   printf ("  register rtx *ro = recog_operand;\n");
   printf ("  register rtx **ro_loc = recog_operand_loc;\n");
   printf ("  rtx pat = PATTERN (insn);\n");
-  printf ("  int i;\n\n");
+  printf ("  int i ATTRIBUTE_UNUSED;\n\n");
   printf ("  switch (INSN_CODE (insn))\n");
   printf ("    {\n");
   printf ("    case -1:\n");
index fd3939843bb77740f1f548331d6602d93a028469..ab65df7b5afb324f6105dd34046d0d962b8ab38e 100644 (file)
@@ -481,7 +481,7 @@ from the machine description file `md'.  */\n\n");
   printf ("#define operands peep_operand\n\n");
 
   printf ("rtx\npeephole (ins1)\n     rtx ins1;\n{\n");
-  printf ("  rtx insn, x, pat;\n\n");
+  printf ("  rtx insn ATTRIBUTE_UNUSED, x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n");
 
   /* Early out: no peepholes for insns followed by barriers.  */
   printf ("  if (NEXT_INSN (ins1)\n");
index 5e56146c42341c9b6eb2be22505737698e3fcc0a..f1fea8123186370aee124ba5d8714bfb9b5e49bf 100644 (file)
@@ -59,7 +59,7 @@ static void __objc_class_add_protocols (Class, struct objc_protocol_list*);
    or a category is loaded into the runtime.  This may e.g. help a
    dynamic loader determine the classes that have been loaded when
    an object file is dynamically linked in */
-void (*_objc_load_callback)(Class class, Category* category) = 0; /* !T:SAFE */
+void (*_objc_load_callback)(Class class, Category* category); /* !T:SAFE */
 
 /* Is all categories/classes resolved? */
 BOOL __objc_dangling_categories = NO;           /* !T:UNUSED */
@@ -280,6 +280,7 @@ objc_postorder_traverse (objc_class_tree *tree,
 }
 
 /* Used to print a tree class hierarchy. */
+#ifdef DEBUG
 static void
 __objc_tree_print (objc_class_tree *tree, int level)
 {
@@ -289,6 +290,7 @@ __objc_tree_print (objc_class_tree *tree, int level)
     printf ("  ");
   printf ("%s\n", tree->class->name);
 }
+#endif
 
 /* Walks on a linked list of methods in the reverse order and executes all
    the methods corresponding to `op' selector. Walking in the reverse order
@@ -381,7 +383,7 @@ __objc_force_linking (void)
 /* Run through the statics list, removing modules as soon as all its statics
    have been initialized.  */
 static void
-objc_init_statics ()
+objc_init_statics (void)
 {
   struct objc_list **cell = &uninitialized_statics;
   struct objc_static_instances **statics_in_module;
index e1cde90b094c3da90e9b0f4aeebc5acf432d6412..9f40371190920027f679cc31bada8e9205e3deed 100644 (file)
@@ -6557,9 +6557,9 @@ encode_array (type, curtype, format)
       return;
     }
 
-  sprintf (buffer, "[%d",
-          (TREE_INT_CST_LOW (an_int_cst)
-           / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
+  sprintf (buffer, "[%ld",
+          (long) (TREE_INT_CST_LOW (an_int_cst)
+                  / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
 
   obstack_grow (&util_obstack, buffer, strlen (buffer));
   encode_type (array_of, curtype, format);
@@ -7361,7 +7361,8 @@ adorn_decl (decl, str)
       tree an_int_cst = TREE_OPERAND (decl, 1);
 
       if (an_int_cst && TREE_CODE (an_int_cst) == INTEGER_CST)
-       sprintf (str + strlen (str), "[%d]", TREE_INT_CST_LOW (an_int_cst));
+       sprintf (str + strlen (str), "[%ld]",
+                (long) TREE_INT_CST_LOW (an_int_cst));
       else
        strcat (str, "[]");
     }
@@ -7372,9 +7373,9 @@ adorn_decl (decl, str)
       tree array_of = TREE_TYPE (decl);
 
       if (an_int_cst && TREE_CODE (an_int_cst) == INTEGER_TYPE)
-       sprintf (str + strlen (str), "[%d]",
-                (TREE_INT_CST_LOW (an_int_cst)
-                 / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
+       sprintf (str + strlen (str), "[%ld]",
+                (long) (TREE_INT_CST_LOW (an_int_cst)
+                        / TREE_INT_CST_LOW (TYPE_SIZE (array_of))));
       else
        strcat (str, "[]");
     }