Warning fixes:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Jun 1998 05:32:38 +0000 (05:32 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Jun 1998 05:32:38 +0000 (05:32 +0000)
        * reload1.c (reload_cse_regs): Cast first arg of `bzero' to char *.
        * sdbout.c: Include output.h and toplev.h.
        (PUT_SDB_INT_VAL): Use HOST_WIDE_INT_PRINT_DEV to print argument
        `a'.  Cast `a' to HOST_WIDE_INT to force it to always be so.
        (PUT_SDB_SIZE): Likewise.
        * sdbout.h (sdbout_mark_begin_function): Add prototype.
        * stmt.c (check_for_full_enumeration_handling): Cast argument of
        `warning' to long and use %ld specifier.
        * toplev.c (main): Likewise for `fprintf'.
        * toplev.h (output_file_directive): Add prototype.
        * unroll.c (unroll_loop): Use HOST_WIDE_INT_PRINT_DEC specifier in
        call to `fprintf'.
        (precondition_loop_p): Likewise.
        * varasm.c Include sdbout.h.
        (assemble_static_space): Move sometimes-unused variable `rounded'
        into the scope in which it is used.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20651 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/reload1.c
gcc/sdbout.c
gcc/sdbout.h
gcc/stmt.c
gcc/toplev.c
gcc/toplev.h
gcc/unroll.c
gcc/varasm.c

index 9484006..99b22c7 100644 (file)
@@ -21,6 +21,30 @@ Mon Jun 22 08:18:46 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
        and use %ld specifier.
        (adorn_decl): Likewise, twice.
 
+       * reload1.c (reload_cse_regs): Cast first arg of `bzero' to char *.
+
+       * sdbout.c: Include output.h and toplev.h.
+       (PUT_SDB_INT_VAL): Use HOST_WIDE_INT_PRINT_DEV to print argument
+       `a'.  Cast `a' to HOST_WIDE_INT to force it to always be so.
+       (PUT_SDB_SIZE): Likewise.
+
+       * sdbout.h (sdbout_mark_begin_function): Add prototype.
+
+       * stmt.c (check_for_full_enumeration_handling): Cast argument of
+       `warning' to long and use %ld specifier.
+
+       * toplev.c (main): Likewise for `fprintf'.
+
+       * toplev.h (output_file_directive): Add prototype.
+
+       * unroll.c (unroll_loop): Use HOST_WIDE_INT_PRINT_DEC specifier in
+       call to `fprintf'.
+       (precondition_loop_p): Likewise.
+
+       * varasm.c Include sdbout.h.
+       (assemble_static_space): Move sometimes-unused variable `rounded'
+       into the scope in which it is used. 
+
 Sun Jun 21 17:05:34 1998  Dave Love  <d.love@dl.ac.uk>
 
        * Makefile.in (install-info): Use install-info program if
index 2220392..3d0c3cb 100644 (file)
@@ -8171,7 +8171,7 @@ reload_cse_regs (first)
   init_alias_analysis ();
 
   reg_values = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
-  bzero (reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
+  bzero ((char *)reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
 
   /* Create our EXPR_LIST structures on reload_obstack, so that we can
      free them when we are done.  */
index 20a71f3..62559a9 100644 (file)
@@ -52,6 +52,8 @@ AT&T C compiler.  From the example below I would conclude the following:
 #include "flags.h"
 #include "insn-config.h"
 #include "reload.h"
+#include "output.h"
+#include "toplev.h"
 
 /* Mips systems use the SDB functions to dump out symbols, but do not
    supply usable syms.h include files.  Which syms.h file to use is a
@@ -171,7 +173,13 @@ static void sdbout_reg_parms               PROTO((tree));
 #endif
 
 #ifndef PUT_SDB_INT_VAL
-#define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\t.val\t%d%s", (a), SDB_DELIM)
+#define PUT_SDB_INT_VAL(a) \
+ do {                                                                  \
+   fputs ("\t.val\t", asm_out_file);                                   \
+   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a));        \
+   fprintf (asm_out_file, "%s", SDB_DELIM);                            \
+ } while (0)
+
 #endif
 
 #ifndef PUT_SDB_VAL
@@ -201,7 +209,12 @@ do { fprintf (asm_out_file, "\t.def\t");   \
 #endif
 
 #ifndef PUT_SDB_SIZE
-#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\t.size\t%d%s", a, SDB_DELIM)
+#define PUT_SDB_SIZE(a) \
+ do {                                                                  \
+   fputs ("\t.size\t", asm_out_file);                                  \
+   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a));        \
+   fprintf (asm_out_file, "%s", SDB_DELIM);                            \
+ } while(0)
 #endif
 
 #ifndef PUT_SDB_START_DIM
index 3ddaa92..dcbd6c1 100644 (file)
@@ -35,4 +35,5 @@ extern void sdbout_end_epilogue               PROTO ((void));
 
 extern void sdbout_start_new_source_file       PROTO ((char *));
 extern void sdbout_resume_previous_source_file PROTO ((void));
+extern void sdbout_mark_begin_function PROTO ((void));
 
index 138783b..feeea17 100644 (file)
@@ -4524,11 +4524,11 @@ check_for_full_enumeration_handling (type)
        if (!chain)
          {
            if (TYPE_NAME (type) == 0)
-             warning ("case value `%d' not in enumerated type",
-                      TREE_INT_CST_LOW (n->low));
+             warning ("case value `%ld' not in enumerated type",
+                      (long) TREE_INT_CST_LOW (n->low));
            else
-             warning ("case value `%d' not in enumerated type `%s'",
-                      TREE_INT_CST_LOW (n->low),
+             warning ("case value `%ld' not in enumerated type `%s'",
+                      (long) TREE_INT_CST_LOW (n->low),
                       IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
                                            == IDENTIFIER_NODE)
                                           ? TYPE_NAME (type)
@@ -4544,11 +4544,11 @@ check_for_full_enumeration_handling (type)
            if (!chain)
              {
                if (TYPE_NAME (type) == 0)
-                 warning ("case value `%d' not in enumerated type",
-                          TREE_INT_CST_LOW (n->high));
+                 warning ("case value `%ld' not in enumerated type",
+                          (long) TREE_INT_CST_LOW (n->high));
                else
-                 warning ("case value `%d' not in enumerated type `%s'",
-                          TREE_INT_CST_LOW (n->high),
+                 warning ("case value `%ld' not in enumerated type `%s'",
+                          (long) TREE_INT_CST_LOW (n->high),
                           IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
                                                == IDENTIFIER_NODE)
                                               ? TYPE_NAME (type)
index dc2effd..fb0245a 100644 (file)
@@ -4410,8 +4410,7 @@ main (argc, argv, envp)
     {
       char *lim = (char *) sbrk (0);
 
-      fprintf (stderr, "Data size %d.\n",
-              lim - (char *) &environ);
+      fprintf (stderr, "Data size %ld.\n", (long)(lim - (char *) &environ));
       fflush (stderr);
 
 #ifndef __MSDOS__
index a598f4d..d206000 100644 (file)
@@ -57,6 +57,7 @@ extern void set_float_handler PROTO((jmp_buf));
 
 #ifdef BUFSIZ
 extern void output_quoted_string       PROTO ((FILE *, char *));
+extern void output_file_directive      PROTO ((FILE *, char *));
 #endif
 
 extern void fancy_abort                        PROTO ((void));
index 8edebda..d390110 100644 (file)
@@ -313,8 +313,11 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
     loop_n_iterations = 0;
 
   if (loop_dump_stream && loop_n_iterations > 0)
-    fprintf (loop_dump_stream,
-            "Loop unrolling: %d iterations.\n", loop_n_iterations);
+    {
+      fputs ("Loop unrolling: ", loop_dump_stream);
+      fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC, loop_n_iterations);
+      fputs (" iterations.\n", loop_dump_stream);
+    }
 
   /* Find and save a pointer to the last nonnote insn in the loop.  */
 
@@ -1312,9 +1315,13 @@ precondition_loop_p (initial_value, final_value, increment, loop_start,
       *final_value = GEN_INT (loop_n_iterations);
 
       if (loop_dump_stream)
-       fprintf (loop_dump_stream,
-                "Preconditioning: Success, number of iterations known, %d.\n",
-                loop_n_iterations);
+       {
+         fputs ("Preconditioning: Success, number of iterations known, ",
+                loop_dump_stream);
+         fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC,
+                  loop_n_iterations);
+         fputs (".\n", loop_dump_stream);
+       }
       return 1;
     }
 
index 22b752d..2d595d4 100644 (file)
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA.  */
 #include "real.h"
 #include "toplev.h"
 #include "dbxout.h"
+#include "sdbout.h"
 
 #include "obstack.h"
 #include "c-pragma.h"
@@ -1683,13 +1684,6 @@ assemble_static_space (size)
   char name[12];
   char *namestring;
   rtx x;
-#ifndef ASM_OUTPUT_ALIGNED_LOCAL
-  /* Round size up to multiple of BIGGEST_ALIGNMENT bits
-     so that each uninitialized object starts on such a boundary.  */
-  int rounded = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
-                / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
-                * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
-#endif
 
 #if 0
   if (flag_shared_data)
@@ -1712,7 +1706,14 @@ assemble_static_space (size)
 #ifdef ASM_OUTPUT_ALIGNED_LOCAL
   ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, BIGGEST_ALIGNMENT);
 #else
-  ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
+  {
+    /* Round size up to multiple of BIGGEST_ALIGNMENT bits
+       so that each uninitialized object starts on such a boundary.  */
+    int rounded = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
+                  / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
+                  * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
+    ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
+  }
 #endif
 #endif
   return x;