From a1b71f21d18cef32dea4bec7e2e72ce6430305f0 Mon Sep 17 00:00:00 2001 From: ghazi Date: Wed, 19 May 1999 11:30:30 +0000 Subject: [PATCH] Warning fixes: * class.c (build_utf8_ref): Initialize variable `field'. * decl.c (init_decl_processing): Initialize variable `field'. * expr.c (build_known_method_ref): Mark parameters `method_type', `method_signature' and `arg_list' with ATTRIBUTE_UNUSED. (process_jvm_instruction): Likewise for parameter `length'. * jvspec.c (lang_specific_driver): Mark variables `saw_math', `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with ATTRIBUTE_UNUSED. * parse.y (maybe_generate_clinit): Remove unused variable `has_non_primitive_fields'. (find_in_imports_on_demand): Initialize variables `node_to_use' and `cl'. (patch_binop): Likewise for variable `prom_type'. (patch_unaryop): Likewise for variable `prom_type'. * verify.c (verify_jvm_instructions): Likewise for variable `last'. * xref.c (xref_table): Add missing initializer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27030 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/ChangeLog | 29 +++++++++++++++++++++++++++-- gcc/java/class.c | 2 +- gcc/java/decl.c | 2 +- gcc/java/expr.c | 5 +++-- gcc/java/jvspec.c | 10 +++++----- gcc/java/parse.c | 15 +++++++-------- gcc/java/parse.y | 9 ++++----- gcc/java/verify.c | 2 +- gcc/java/xref.c | 2 +- 9 files changed, 50 insertions(+), 26 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 23eadc9..d3cb633 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,28 @@ +1999-05-19 Kaveh R. Ghazi + + * class.c (build_utf8_ref): Initialize variable `field'. + + * decl.c (init_decl_processing): Initialize variable `field'. + + * expr.c (build_known_method_ref): Mark parameters `method_type', + `method_signature' and `arg_list' with ATTRIBUTE_UNUSED. + (process_jvm_instruction): Likewise for parameter `length'. + + * jvspec.c (lang_specific_driver): Mark variables `saw_math', + `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with + ATTRIBUTE_UNUSED. + + * parse.y (maybe_generate_clinit): Remove unused variable + `has_non_primitive_fields'. + (find_in_imports_on_demand): Initialize variables `node_to_use' + and `cl'. + (patch_binop): Likewise for variable `prom_type'. + (patch_unaryop): Likewise for variable `prom_type'. + + * verify.c (verify_jvm_instructions): Likewise for variable `last'. + + * xref.c (xref_table): Add missing initializer. + 1999-05-14 Tom Tromey * java-except.h (struct eh_range): Removed unused `next' member. @@ -70,13 +95,13 @@ Thu May 13 13:23:38 1999 Alexandre Petit-Bianco * xref.h (xref_get_data): New function, declared. (XREF_GET_DATA): Use xref_get_data. -1999-05-13 Kaveh R. Ghazi +1999-05-13 Kaveh R. Ghazi * gjavah.c (print_include): Cast the result of `strlen' to int when comparing against a signed value. (add_namelet): Likewise. -1999-05-12 Kaveh R. Ghazi +1999-05-12 Kaveh R. Ghazi * expr.c (expand_invoke): Mark parameter `nargs' with ATTRIBUTE_UNUSED. diff --git a/gcc/java/class.c b/gcc/java/class.c index 2e00e74..4fea18d 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -559,7 +559,7 @@ build_utf8_ref (name) int name_len = IDENTIFIER_LENGTH(name); char buf[60]; char *buf_ptr; - tree ctype, field, str_type, cinit, string; + tree ctype, field = NULL_TREE, str_type, cinit, string; static int utf8_count = 0; int name_hash; tree ref = IDENTIFIER_UTF8_REF (name); diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 625ba8a..de03e5fd 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -432,7 +432,7 @@ void init_decl_processing () { register tree endlink; - tree field; + tree field = NULL_TREE; tree t; current_function_decl = NULL; diff --git a/gcc/java/expr.c b/gcc/java/expr.c index d975c42..79d0b7b 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1431,7 +1431,8 @@ tree dtable_ident = NULL_TREE; tree build_known_method_ref (method, method_type, self_type, method_signature, arg_list) - tree method, method_type, self_type, method_signature, arg_list; + tree method, method_type ATTRIBUTE_UNUSED, self_type, + method_signature ATTRIBUTE_UNUSED, arg_list ATTRIBUTE_UNUSED; { tree func; if (is_compiled_class (self_type)) @@ -2230,7 +2231,7 @@ int process_jvm_instruction (PC, byte_ops, length) int PC; unsigned char* byte_ops; - long length; + long length ATTRIBUTE_UNUSED; { const char *opname; /* Temporary ??? */ int oldpc = PC; /* PC at instruction start. */ diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 95330da..815ff3f 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -145,19 +145,19 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) int saw_speclang = 0; /* "-lm" or "-lmath" if it appears on the command line. */ - char *saw_math = 0; + char *saw_math ATTRIBUTE_UNUSED = 0; /* "-lc" if it appears on the command line. */ - char *saw_libc = 0; + char *saw_libc ATTRIBUTE_UNUSED = 0; /* "-lgcjgc" if it appears on the command line. */ - char *saw_gc = 0; + char *saw_gc ATTRIBUTE_UNUSED = 0; /* Saw `-l' option for the thread library. */ - char *saw_threadlib = 0; + char *saw_threadlib ATTRIBUTE_UNUSED = 0; /* Saw `-lgcj' on command line. */ - int saw_libgcj = 0; + int saw_libgcj ATTRIBUTE_UNUSED = 0; /* Saw -C or -o option, respectively. */ int saw_C = 0; diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 2fc3491..5895910 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -2211,7 +2211,7 @@ static const short yycheck[] = { 3, #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/lib/bison.simple" +#line 3 "/usr/local/gnu/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -2404,7 +2404,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "/usr/lib/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 *. @@ -4690,7 +4690,7 @@ case 495: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/lib/bison.simple" +#line 498 "/usr/local/gnu/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -5850,7 +5850,6 @@ static void maybe_generate_clinit () { tree mdecl, c; - int has_non_primitive_fields = 0; if (!ctxp->static_initialized || java_error_count) return; @@ -7735,9 +7734,9 @@ static int find_in_imports_on_demand (class_type) tree class_type; { - tree node, import, node_to_use; + tree node, import, node_to_use = NULL_TREE; int seen_once = -1; - tree cl; + tree cl = NULL_TREE; for (import = ctxp->import_demand_list; import; import = TREE_CHAIN (import)) { @@ -11811,7 +11810,7 @@ patch_binop (node, wfl_op1, wfl_op2) tree op2 = TREE_OPERAND (node, 1); tree op1_type = TREE_TYPE (op1); tree op2_type = TREE_TYPE (op2); - tree prom_type; + tree prom_type = NULL_TREE; int code = TREE_CODE (node); /* If 1, tell the routine that we have to return error_mark_node @@ -12437,7 +12436,7 @@ patch_unaryop (node, wfl_op) { tree op = TREE_OPERAND (node, 0); tree op_type = TREE_TYPE (op); - tree prom_type, value, decl; + tree prom_type = NULL_TREE, value, decl; int code = TREE_CODE (node); int error_found = 0; diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 3013c76..a6f598e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -3265,7 +3265,6 @@ static void maybe_generate_clinit () { tree mdecl, c; - int has_non_primitive_fields = 0; if (!ctxp->static_initialized || java_error_count) return; @@ -5150,9 +5149,9 @@ static int find_in_imports_on_demand (class_type) tree class_type; { - tree node, import, node_to_use; + tree node, import, node_to_use = NULL_TREE; int seen_once = -1; - tree cl; + tree cl = NULL_TREE; for (import = ctxp->import_demand_list; import; import = TREE_CHAIN (import)) { @@ -9226,7 +9225,7 @@ patch_binop (node, wfl_op1, wfl_op2) tree op2 = TREE_OPERAND (node, 1); tree op1_type = TREE_TYPE (op1); tree op2_type = TREE_TYPE (op2); - tree prom_type; + tree prom_type = NULL_TREE; int code = TREE_CODE (node); /* If 1, tell the routine that we have to return error_mark_node @@ -9852,7 +9851,7 @@ patch_unaryop (node, wfl_op) { tree op = TREE_OPERAND (node, 0); tree op_type = TREE_TYPE (op); - tree prom_type, value, decl; + tree prom_type = NULL_TREE, value, decl; int code = TREE_CODE (node); int error_found = 0; diff --git a/gcc/java/verify.c b/gcc/java/verify.c index ef0f85e..df3dcac 100644 --- a/gcc/java/verify.c +++ b/gcc/java/verify.c @@ -1039,7 +1039,7 @@ verify_jvm_instructions (jcf, byte_ops, length) case OPCODE_lookupswitch: { - jint npairs, last, not_registered = 1; + jint npairs, last = 0, not_registered = 1; pop_type (int_type_node); while (PC%4) diff --git a/gcc/java/xref.c b/gcc/java/xref.c index 8835e8d..8fd5180 100644 --- a/gcc/java/xref.c +++ b/gcc/java/xref.c @@ -35,7 +35,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ static xref_flag_table xref_table [] = { - {NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL}, }; /* Decode an xref flag value. Return 0 if the flag wasn't found. */ -- 2.7.4