Commit 7e21fe59 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Warning fixes:

        * 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'.

From-SVN: r25731
parent 6e0f130b
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> 1999-03-12 Andrew Haley <aph@cygnus.com>
* jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes; * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
......
...@@ -123,7 +123,7 @@ find_class_or_string_constant (cpool, tag, name) ...@@ -123,7 +123,7 @@ find_class_or_string_constant (cpool, tag, name)
int i; int i;
for (i = cpool->count; --i > 0; ) 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; return i;
} }
i = cpool->count; i = cpool->count;
......
...@@ -1750,8 +1750,6 @@ java_lang_expand_expr (exp, target, tmode, modifier) ...@@ -1750,8 +1750,6 @@ java_lang_expand_expr (exp, target, tmode, modifier)
enum expand_modifier modifier; enum expand_modifier modifier;
{ {
tree current; tree current;
int has_finally_p;
rtx op0;
switch (TREE_CODE (exp)) switch (TREE_CODE (exp))
{ {
......
...@@ -335,7 +335,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags), ...@@ -335,7 +335,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags),
num = JPOOL_INT (jcf, current_field_value); num = JPOOL_INT (jcf, current_field_value);
/* We single out the most negative number to print /* We single out the most negative number to print
specially. This avoids later warnings from g++. */ specially. This avoids later warnings from g++. */
if (num == 0x80000000) if (num == (jint) 0x80000000)
{ {
most_negative = 1; most_negative = 1;
++num; ++num;
...@@ -354,7 +354,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags), ...@@ -354,7 +354,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags),
num = JPOOL_LONG (jcf, current_field_value); num = JPOOL_LONG (jcf, current_field_value);
/* We single out the most negative number to print /* We single out the most negative number to print
specially.. This avoids later warnings from g++. */ specially.. This avoids later warnings from g++. */
if (num == 0x8000000000000000LL) if (num == (jlong) 0x8000000000000000LL)
{ {
most_negative = 1; most_negative = 1;
++num; ++num;
...@@ -920,11 +920,11 @@ add_namelet (name, name_limit, parent) ...@@ -920,11 +920,11 @@ add_namelet (name, name_limit, parent)
#define JAVALANG "java/lang/" #define JAVALANG "java/lang/"
#define JAVAIO "java/io/" #define JAVAIO "java/io/"
#define JAVAUTIL "java/util/" #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)) && ! 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)) && ! 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))) && ! strncmp (name, JAVAIO, sizeof (JAVAIO) - 1)))
return; return;
} }
......
...@@ -520,8 +520,7 @@ DEFUN(print_signature_type, (stream, ptr, limit), ...@@ -520,8 +520,7 @@ DEFUN(print_signature_type, (stream, ptr, limit),
array_size = -1; array_size = -1;
for ((*ptr)++; (*ptr) < limit && ISDIGIT (**ptr); (*ptr)++) 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); print_signature_type (stream, ptr, limit);
if (array_size == -1) if (array_size == -1)
...@@ -592,7 +591,7 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options), ...@@ -592,7 +591,7 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options),
} }
if (options & PRINT_SIGNATURE_ARGS_ONLY) if (options & PRINT_SIGNATURE_ARGS_ONLY)
{ {
*str++; str++;
fputc ('(', stream); fputc ('(', stream);
while (str < limit && *str != ')') while (str < limit && *str != ')')
{ {
......
...@@ -72,8 +72,8 @@ DEFUN(get_attribute, (jcf), ...@@ -72,8 +72,8 @@ DEFUN(get_attribute, (jcf),
if (name_length == 4 && memcmp (name_data, "Code", 4) == 0) if (name_length == 4 && memcmp (name_data, "Code", 4) == 0)
{ {
uint16 j; uint16 j;
uint16 max_stack = JCF_readu2 (jcf); uint16 max_stack ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
uint16 max_locals = JCF_readu2 (jcf); uint16 max_locals ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
uint32 code_length = JCF_readu4 (jcf); uint32 code_length = JCF_readu4 (jcf);
uint16 exception_table_length, attributes_count; uint16 exception_table_length, attributes_count;
if (code_length + 12 > attribute_length) if (code_length + 12 > attribute_length)
...@@ -242,7 +242,7 @@ DEFUN(jcf_parse_class, (jcf), ...@@ -242,7 +242,7 @@ DEFUN(jcf_parse_class, (jcf),
/* Read interfaces. */ /* Read interfaces. */
for (i = 0; i < interfaces_count; i++) for (i = 0; i < interfaces_count; i++)
{ {
uint16 index = JCF_readu2 (jcf); uint16 index ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
#ifdef HANDLE_CLASS_INTERFACE #ifdef HANDLE_CLASS_INTERFACE
HANDLE_CLASS_INTERFACE (index); HANDLE_CLASS_INTERFACE (index);
#endif #endif
......
...@@ -5,13 +5,6 @@ ...@@ -5,13 +5,6 @@
#define YYBISON 1 /* Identify Bison output. */ #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 PLUS_TK 258
#define MINUS_TK 259 #define MINUS_TK 259
#define MULT_TK 260 #define MULT_TK 260
...@@ -275,7 +268,6 @@ static tree string_constant_concatenation PROTO ((tree, tree)); ...@@ -275,7 +268,6 @@ static tree string_constant_concatenation PROTO ((tree, tree));
static tree build_string_concatenation PROTO ((tree, tree)); static tree build_string_concatenation PROTO ((tree, tree));
static tree patch_string_cst PROTO ((tree)); static tree patch_string_cst PROTO ((tree));
static tree patch_string 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_statement PROTO ((int, tree, tree));
static tree build_try_finally_statement PROTO ((int, tree, tree)); static tree build_try_finally_statement PROTO ((int, tree, tree));
static tree patch_try_statement PROTO ((tree)); static tree patch_try_statement PROTO ((tree));
...@@ -315,6 +307,7 @@ static char *purify_type_name PROTO ((char *)); ...@@ -315,6 +307,7 @@ static char *purify_type_name PROTO ((char *));
static tree patch_initialized_static_field PROTO ((tree)); static tree patch_initialized_static_field PROTO ((tree));
static tree fold_constant_for_init PROTO ((tree, tree)); static tree fold_constant_for_init PROTO ((tree, tree));
static tree strip_out_static_field_access_decl PROTO ((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. */ /* Number of error found so far. */
int java_error_count; int java_error_count;
...@@ -2217,7 +2210,7 @@ static const short yycheck[] = { 3, ...@@ -2217,7 +2210,7 @@ static const short yycheck[] = { 3,
#define YYPURE 1 #define YYPURE 1
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ /* -*-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, /* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
...@@ -2234,7 +2227,7 @@ static const short yycheck[] = { 3, ...@@ -2234,7 +2227,7 @@ static const short yycheck[] = { 3,
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software 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 /* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction. Bison output file, you may use that output file without restriction.
...@@ -2410,7 +2403,7 @@ __yy_memcpy (char *to, char *from, int count) ...@@ -2410,7 +2403,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif #endif
#endif #endif
#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 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *. into yyparse. The argument should have type void *.
...@@ -4675,7 +4668,7 @@ case 493: ...@@ -4675,7 +4668,7 @@ case 493:
break;} break;}
} }
/* the action file gets copied in in place of this dollarsign */ /* 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"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
...@@ -13313,36 +13306,6 @@ patch_switch_statement (node) ...@@ -13313,36 +13306,6 @@ patch_switch_statement (node)
/* 14.18 The try statement */ /* 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 static tree
build_try_statement (location, try_block, catches) build_try_statement (location, try_block, catches)
int location; int location;
......
...@@ -392,7 +392,6 @@ typedef struct _jdeplist { ...@@ -392,7 +392,6 @@ typedef struct _jdeplist {
jdep *last; jdep *last;
struct _jdeplist *next; struct _jdeplist *next;
} jdeplist; } jdeplist;
static jdeplist *reverse_jdep_list ();
#endif /* JC1_LITE */ #endif /* JC1_LITE */
......
...@@ -199,7 +199,6 @@ static tree string_constant_concatenation PROTO ((tree, tree)); ...@@ -199,7 +199,6 @@ static tree string_constant_concatenation PROTO ((tree, tree));
static tree build_string_concatenation PROTO ((tree, tree)); static tree build_string_concatenation PROTO ((tree, tree));
static tree patch_string_cst PROTO ((tree)); static tree patch_string_cst PROTO ((tree));
static tree patch_string 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_statement PROTO ((int, tree, tree));
static tree build_try_finally_statement PROTO ((int, tree, tree)); static tree build_try_finally_statement PROTO ((int, tree, tree));
static tree patch_try_statement PROTO ((tree)); static tree patch_try_statement PROTO ((tree));
...@@ -239,6 +238,7 @@ static char *purify_type_name PROTO ((char *)); ...@@ -239,6 +238,7 @@ static char *purify_type_name PROTO ((char *));
static tree patch_initialized_static_field PROTO ((tree)); static tree patch_initialized_static_field PROTO ((tree));
static tree fold_constant_for_init PROTO ((tree, tree)); static tree fold_constant_for_init PROTO ((tree, tree));
static tree strip_out_static_field_access_decl PROTO ((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. */ /* Number of error found so far. */
int java_error_count; int java_error_count;
...@@ -10711,36 +10711,6 @@ patch_switch_statement (node) ...@@ -10711,36 +10711,6 @@ patch_switch_statement (node)
/* 14.18 The try statement */ /* 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 static tree
build_try_statement (location, try_block, catches) build_try_statement (location, try_block, catches)
int location; int location;
......
...@@ -66,7 +66,6 @@ static tree ...@@ -66,7 +66,6 @@ static tree
convert_ieee_real_to_integer (type, expr) convert_ieee_real_to_integer (type, expr)
tree type, expr; tree type, expr;
{ {
tree assignment, expr_decl;
expr = save_expr (expr); expr = save_expr (expr);
return build (COND_EXPR, type, return build (COND_EXPR, type,
......
...@@ -786,7 +786,6 @@ verify_jvm_instructions (jcf, byte_ops, length) ...@@ -786,7 +786,6 @@ verify_jvm_instructions (jcf, byte_ops, length)
break; break;
/* ... else fall through ... */ /* ... else fall through ... */
default: default:
bad_ldc:
VERIFICATION_ERROR ("bad constant pool tag in ldc"); VERIFICATION_ERROR ("bad constant pool tag in ldc");
} }
if (type == int_type_node) if (type == int_type_node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment