OSDN Git Service

Warning fixes:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Mar 1999 17:13:24 +0000 (17:13 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Mar 1999 17:13:24 +0000 (17:13 +0000)
        * constants.c (find_class_or_string_constant): Cast variable `j'
        to a `jword' when comparing against one.
        * expr.c (java_lang_expand_expr): Remove unused variables
        `has_finally_p' and `op0'.
        * gjavah.c (print_field_info): Cast a value to jint when comparing
        against one.  Likewise for a jlong.
        (add_namelet): Likewise cast a `sizeof' to an int when comparing
        against a signed quantity.
        * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
        (print_signature): Don't needlessly dereference variable `str'
        * jcf-reader.c (get_attribute): Mark variables `max_stack' and
        `max_locals' with ATTRIBUTE_UNUSED.
        (jcf_parse_class): Likewise for variable `index'.
        * parse.h (reverse_jdep_list): Remove static prototype.
        * parse.y (build_jump_to_finally): Remove prototype and definition.
        (reverse_jdep_list): Add static prototype.
        * typeck.c (convert_ieee_real_to_integer): Remove unused variables
        `assignment' and `expr_decl'.
        * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.

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

gcc/java/ChangeLog
gcc/java/constants.c
gcc/java/expr.c
gcc/java/gjavah.c
gcc/java/jcf-dump.c
gcc/java/jcf-reader.c
gcc/java/parse.c
gcc/java/parse.h
gcc/java/parse.y
gcc/java/typeck.c
gcc/java/verify.c

index ecd1b52..f582925 100644 (file)
@@ -1,3 +1,33 @@
+Fri Mar 12 19:42:55 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * constants.c (find_class_or_string_constant): Cast variable `j'
+       to a `jword' when comparing against one.
+
+       * expr.c (java_lang_expand_expr): Remove unused variables
+       `has_finally_p' and `op0'.
+
+       * gjavah.c (print_field_info): Cast a value to jint when comparing
+       against one.  Likewise for a jlong.
+       (add_namelet): Likewise cast a `sizeof' to an int when comparing
+       against a signed quantity.
+       
+       * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
+       (print_signature): Don't needlessly dereference variable `str'
+
+       * jcf-reader.c (get_attribute): Mark variables `max_stack' and
+       `max_locals' with ATTRIBUTE_UNUSED.
+       (jcf_parse_class): Likewise for variable `index'.
+
+       * parse.h (reverse_jdep_list): Remove static prototype.
+
+       * parse.y (build_jump_to_finally): Remove prototype and definition.
+       (reverse_jdep_list): Add static prototype.
+
+       * typeck.c (convert_ieee_real_to_integer): Remove unused variables
+       `assignment' and `expr_decl'.
+
+       * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
+
 1999-03-12  Andrew Haley  <aph@cygnus.com>
 
        * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
index 3679d4e..81ff7ad 100644 (file)
@@ -123,7 +123,7 @@ find_class_or_string_constant (cpool, tag, name)
   int i;
   for (i = cpool->count;  --i > 0; )
     {
-      if (cpool->tags[i] == tag && cpool->data[i] == j)
+      if (cpool->tags[i] == tag && cpool->data[i] == (jword) j)
        return i;
     }
   i = cpool->count;
index 6daeb92..15ac0c2 100644 (file)
@@ -1750,8 +1750,6 @@ java_lang_expand_expr (exp, target, tmode, modifier)
      enum expand_modifier modifier;
 {
   tree current;
-  int has_finally_p;
-  rtx op0;
 
   switch (TREE_CODE (exp))
     {
index 5ec6a88..9b32836 100644 (file)
@@ -335,7 +335,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags),
                num = JPOOL_INT (jcf, current_field_value);
                /* We single out the most negative number to print
                   specially.  This avoids later warnings from g++.  */
-               if (num == 0x80000000)
+               if (num == (jint) 0x80000000)
                  {
                    most_negative = 1;
                    ++num;
@@ -354,7 +354,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags),
                num = JPOOL_LONG (jcf, current_field_value);
                /* We single out the most negative number to print
                    specially..  This avoids later warnings from g++.  */
-               if (num == 0x8000000000000000LL)
+               if (num == (jlong) 0x8000000000000000LL)
                  {
                    most_negative = 1;
                    ++num;
@@ -920,11 +920,11 @@ add_namelet (name, name_limit, parent)
 #define JAVALANG "java/lang/"
 #define JAVAIO "java/io/"
 #define JAVAUTIL "java/util/"
-      if ((name_limit - name >= sizeof (JAVALANG) - 1
+      if ((name_limit - name >= (int) sizeof (JAVALANG) - 1
           && ! strncmp (name, JAVALANG, sizeof (JAVALANG) - 1))
-         || (name_limit - name >= sizeof (JAVAUTIL) - 1
+         || (name_limit - name >= (int) sizeof (JAVAUTIL) - 1
              && ! strncmp (name, JAVAUTIL, sizeof (JAVAUTIL) - 1))
-         || (name_limit - name >= sizeof (JAVAIO) - 1
+         || (name_limit - name >= (int) sizeof (JAVAIO) - 1
              && ! strncmp (name, JAVAIO, sizeof (JAVAIO) - 1)))
        return;
     }
index 4512bcd..b48c0b4 100644 (file)
@@ -520,8 +520,7 @@ DEFUN(print_signature_type, (stream, ptr, limit),
       array_size = -1;
       for ((*ptr)++; (*ptr) < limit && ISDIGIT (**ptr); (*ptr)++)
        {
-         int digit = 
-           array_size = (array_size < 0 ? 0 : 10 * array_size) + *(*ptr) - '0';
+         array_size = (array_size < 0 ? 0 : 10 * array_size) + *(*ptr) - '0';
        }
       print_signature_type (stream, ptr, limit);
       if (array_size == -1)
@@ -592,7 +591,7 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options),
            }
          if (options & PRINT_SIGNATURE_ARGS_ONLY)
            {
-             *str++;
+             str++;
              fputc ('(', stream);
              while (str < limit && *str != ')')
                {
index 49a9b16..accb1a1 100644 (file)
@@ -72,8 +72,8 @@ DEFUN(get_attribute, (jcf),
   if (name_length == 4 && memcmp (name_data, "Code", 4) == 0)
     {
       uint16 j;
-      uint16 max_stack = JCF_readu2 (jcf);
-      uint16 max_locals = JCF_readu2 (jcf);
+      uint16 max_stack ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
+      uint16 max_locals ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
       uint32 code_length = JCF_readu4 (jcf);
       uint16 exception_table_length, attributes_count;
       if (code_length + 12 > attribute_length)
@@ -242,7 +242,7 @@ DEFUN(jcf_parse_class, (jcf),
   /* Read interfaces. */
   for (i = 0; i < interfaces_count; i++)
     {
-      uint16 index = JCF_readu2 (jcf);
+      uint16 index ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
 #ifdef HANDLE_CLASS_INTERFACE
       HANDLE_CLASS_INTERFACE (index);
 #endif
index 6579a3d..485ed0e 100644 (file)
@@ -5,13 +5,6 @@
 
 #define YYBISON 1  /* Identify Bison output.  */
 
-#define yyparse java_parse
-#define yylex java_lex
-#define yyerror java_error
-#define yylval java_lval
-#define yychar java_char
-#define yydebug java_debug
-#define yynerrs java_nerrs
 #define        PLUS_TK 258
 #define        MINUS_TK        259
 #define        MULT_TK 260
@@ -275,7 +268,6 @@ static tree string_constant_concatenation PROTO ((tree, tree));
 static tree build_string_concatenation PROTO ((tree, tree));
 static tree patch_string_cst PROTO ((tree));
 static tree patch_string PROTO ((tree));
-static tree build_jump_to_finally PROTO ((tree, tree, tree, tree));
 static tree build_try_statement PROTO ((int, tree, tree));
 static tree build_try_finally_statement PROTO ((int, tree, tree));
 static tree patch_try_statement PROTO ((tree));
@@ -315,6 +307,7 @@ static char *purify_type_name PROTO ((char *));
 static tree patch_initialized_static_field PROTO ((tree));
 static tree fold_constant_for_init PROTO ((tree, tree));
 static tree strip_out_static_field_access_decl PROTO ((tree));
+static jdeplist *reverse_jdep_list PROTO ((struct parser_ctxt *));
 
 /* Number of error found so far. */
 int java_error_count; 
@@ -2217,7 +2210,7 @@ static const short yycheck[] = {     3,
 #define YYPURE 1
 
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/share/misc/bison.simple"
+#line 3 "/usr/local/gnu/share/bison.simple"
 
 /* Skeleton output parser for bison,
    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -2234,7 +2227,7 @@ static const short yycheck[] = {     3,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* As a special exception, when this file is copied by Bison into a
    Bison output file, you may use that output file without restriction.
@@ -2410,7 +2403,7 @@ __yy_memcpy (char *to, char *from, int count)
 #endif
 #endif
 \f
-#line 196 "/usr/share/misc/bison.simple"
+#line 196 "/usr/local/gnu/share/bison.simple"
 
 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
    into yyparse.  The argument should have type void *.
@@ -4675,7 +4668,7 @@ case 493:
     break;}
 }
    /* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/misc/bison.simple"
+#line 498 "/usr/local/gnu/share/bison.simple"
 \f
   yyvsp -= yylen;
   yyssp -= yylen;
@@ -13313,36 +13306,6 @@ patch_switch_statement (node)
 
 /* 14.18 The try statement */
 
-/* Wrap BLOCK around a LABELED_BLOCK, set DECL to the newly generated
-   exit labeld and issue a jump to FINALLY_LABEL:
-     
-   LABELED_BLOCK
-     BLOCK
-       <orignal_statments>
-       DECL = &LABEL_DECL
-       GOTO_EXPR
-         FINALLY_LABEL
-     LABEL_DECL */
-
-static tree
-build_jump_to_finally (block, decl, finally_label, type)
-     tree block, decl, finally_label, type;
-{
-  tree stmt;
-  tree new_block = build (LABELED_BLOCK_EXPR, type,
-                         create_label_decl (generate_name ()), block);
-
-  stmt = build (MODIFY_EXPR, void_type_node, decl,
-               build_address_of (LABELED_BLOCK_LABEL (new_block)));
-  TREE_SIDE_EFFECTS (stmt) = 1;
-  CAN_COMPLETE_NORMALLY (stmt) = 1;
-  add_stmt_to_block (block, type, stmt);
-  stmt = build (GOTO_EXPR, void_type_node, finally_label);
-  TREE_SIDE_EFFECTS (stmt) = 1;
-  add_stmt_to_block (block, type, stmt);
-  return new_block;
-}
-
 static tree
 build_try_statement (location, try_block, catches)
      int location;
index 5326669..f917127 100644 (file)
@@ -392,7 +392,6 @@ typedef struct _jdeplist {
   jdep *last;
   struct _jdeplist *next;
 } jdeplist;
-static jdeplist *reverse_jdep_list ();
 
 #endif /* JC1_LITE */
 
index c26a7cc..ad6122b 100644 (file)
@@ -199,7 +199,6 @@ static tree string_constant_concatenation PROTO ((tree, tree));
 static tree build_string_concatenation PROTO ((tree, tree));
 static tree patch_string_cst PROTO ((tree));
 static tree patch_string PROTO ((tree));
-static tree build_jump_to_finally PROTO ((tree, tree, tree, tree));
 static tree build_try_statement PROTO ((int, tree, tree));
 static tree build_try_finally_statement PROTO ((int, tree, tree));
 static tree patch_try_statement PROTO ((tree));
@@ -239,6 +238,7 @@ static char *purify_type_name PROTO ((char *));
 static tree patch_initialized_static_field PROTO ((tree));
 static tree fold_constant_for_init PROTO ((tree, tree));
 static tree strip_out_static_field_access_decl PROTO ((tree));
+static jdeplist *reverse_jdep_list PROTO ((struct parser_ctxt *));
 
 /* Number of error found so far. */
 int java_error_count; 
@@ -10711,36 +10711,6 @@ patch_switch_statement (node)
 
 /* 14.18 The try statement */
 
-/* Wrap BLOCK around a LABELED_BLOCK, set DECL to the newly generated
-   exit labeld and issue a jump to FINALLY_LABEL:
-     
-   LABELED_BLOCK
-     BLOCK
-       <orignal_statments>
-       DECL = &LABEL_DECL
-       GOTO_EXPR
-         FINALLY_LABEL
-     LABEL_DECL */
-
-static tree
-build_jump_to_finally (block, decl, finally_label, type)
-     tree block, decl, finally_label, type;
-{
-  tree stmt;
-  tree new_block = build (LABELED_BLOCK_EXPR, type,
-                         create_label_decl (generate_name ()), block);
-
-  stmt = build (MODIFY_EXPR, void_type_node, decl,
-               build_address_of (LABELED_BLOCK_LABEL (new_block)));
-  TREE_SIDE_EFFECTS (stmt) = 1;
-  CAN_COMPLETE_NORMALLY (stmt) = 1;
-  add_stmt_to_block (block, type, stmt);
-  stmt = build (GOTO_EXPR, void_type_node, finally_label);
-  TREE_SIDE_EFFECTS (stmt) = 1;
-  add_stmt_to_block (block, type, stmt);
-  return new_block;
-}
-
 static tree
 build_try_statement (location, try_block, catches)
      int location;
index d52d7fd..ad0ba4c 100644 (file)
@@ -66,7 +66,6 @@ static tree
 convert_ieee_real_to_integer (type, expr)
      tree type, expr;
 {
-  tree assignment, expr_decl;
   expr = save_expr (expr);
 
   return build (COND_EXPR, type, 
index a6771db..4b6ffff 100644 (file)
@@ -786,7 +786,6 @@ verify_jvm_instructions (jcf, byte_ops, length)
                break;
              /* ... else fall through ... */
            default:
-           bad_ldc:
              VERIFICATION_ERROR ("bad constant pool tag in ldc");
            }
          if (type == int_type_node)