diff options
-rw-r--r-- | gcc/java/ChangeLog | 111 | ||||
-rw-r--r-- | gcc/java/java-tree.h | 14 | ||||
-rw-r--r-- | gcc/java/lang.c | 37 | ||||
-rw-r--r-- | gcc/java/lex.c | 72 | ||||
-rw-r--r-- | gcc/java/lex.h | 1 | ||||
-rw-r--r-- | gcc/java/parse.h | 17 | ||||
-rw-r--r-- | gcc/java/parse.y | 234 |
7 files changed, 290 insertions, 196 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 64aa6e0..47467c0 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,114 @@ +Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com> + + * java-tree.h (pop_labeled_block, lang_printable_name, + maybe_add_interface, set_super_info, get_access_flags_from_decl, + interface_of_p, inherits_from_p, fix_classpath, + complete_start_java_method, emit_handlers, init_outgoing_cpool, + make_class_data, register_class, alloc_name_constant): New + function prototypes. + * lang.c (lang_decode_option): Set argc argument unused. Fixed + indentation. Added cast to remove warning. + (lang_printable_name): Set v argument unused. + (lang_print_error): Added argument to lang_printable_name call. + (java_dummy_print, print_lang_decl, print_lang_type, + print_lang_identifier, lang_print_xnode): All argument marked + unused. + * lex.c (java_unget_unicode): Removed unnecessary argument. + (java_allocate_new_line): Unused local variable is gone. + (java_read_char): Added parenthesis in expressions to remove + warnings. Added final return statement. + (java_read_unicode): Added parenthesis in expression to remove + warning. + (java_parse_end_comment): Fixed java_unget_unicode invocation. + (java_parse_escape_sequence): Likewise. + (java_lex): Unused local variables are gone. Fixed + java_unget_unicode invocation. + * lex.h (set_float_handler): Prototype added when JC1_LITE not + defined. + * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed + lang_printable_name invocation in macro. + (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL): + Likewise. + (duplicate_declaration_error): Suppressed unused argument in + prototype. + (identical_subpath_p): Function declaration is gone. + (patch_invoke): Suppressed unused argument in prototype. + (patch_cast, build_labeled_block, check_thrown_exceptions): + Likewise. + * parse.y (setjmp.h): Included + (toplev.h): Likewise. + (field_declaration:): Suppressed unused local + (label_decl:): Fixed build_labeled_block invocation. + (java_pop_parser_context): Put extra parenthesis around assignment + in if. + (yyerror): Suppressed unused local variables. + (variable_redefinition_error): Fixed lang_printable_name + invocation. + (create_interface): Suppressed unused local variables. + (create_class): Likewise. + (duplicate_declaration_error): Suppressed unused argument. Fixed + lang_printable_name invocation. + (register_fields): Suppressed unused local variable. Fixed + duplicate_declaration_error invocation. + (method_header): Suppressed unused local variable. + (method_declarator, parser_check_super): Likewise. + (java_complete_class): Suppressed unused local variable. Fixed + fatal error message. + (complete_class_report_errors): Added default: in switch. + (java_check_regular_methods): Fixed lang_printable_name + invocations. + (check_throws_clauses): Likewise. + (java_check_abstract_methods): Suppressed unused local + variable. Fixed lang_printable_name invocation. + (read_import_entry): Added supplemental return statement. + (read_import_dir): Suppressed unused local variables. + (check_pkg_class_access, declare_local_variables): Likewise. + (source_start_java_method): Suppressed unused extern variable + declarations + (expand_start_java_method): Suppressed unused extern and local + variable declarations. + (java_complete_expand_methods): Likewise. + (java_complete_expand_method): Suppressed unused local variables. + (make_qualified_name): Likewise. + (resolve_qualified_expression_name): Added default: in + switch. Fixed lang_printable_name invocation. + (class_instance_creation_expression): Added parenthesis around + expressions. + (patch_method_invocation_stmt): Fixed lang_printable_name and + patch_invoke invocations. + (check_for_static_method_reference): Fixed lang_printable_name + invocation. + (patch_invoke): Suppressed unused arguments and local variables. + (lookup_method_invoke): Suppressed unused local variables. + (qualify_ambiguous_name): Added default: in switch. + (identical_subpath_p): Function removed. + (patch_assignment): Suppressed unused local variables. Suppressed + unnecessary if statement. Fixed lang_printable_name invocations. + (try_builtin_assignconv): Fixed lang_printable_name invocations. + (valid_ref_assignconv_cast_p): Parenthesis around + expression. Suppressed unused local variables. + (build_binop): Suppressed unused local variables. fixed + lang_printable_name invocations. + (string_constant_concatenation): Suppressed unused local + variables. + (patch_unaryop): Fixed lang_printable_name invocation. + (patch_cast): Suppressed unnecessary argument. Fixed + lang_printable_name invocation. + (patch_array_ref): Fixed lang_printable_name invocation. + (patch_newarray, patch_return, patch_if_else_statement): Likewise. + (build_labeled_block): Suppressed unused argument. + (generate_labeled_block): Fixed build_labeled_block invocation. + (build_loop_body): Suppressed unused local variables. + (patch_loop_statement): Likewise. + (patch_exit): Fixed lang_printable_name invocation. + (patch_switch_statement): Likewise. + (case_identity): First argument marked unused. + (patch_try_statement): Fixed lang_printable_name invocations. + (patch_synchronized_statement, patch_throw_statement): Likewise. + (check_thrown_exceptions): Fixed check_thrown_exceptions and + lang_printable_name invocations. + (check_thrown_exceptions_do): Suppressed unused argument. + 1998-10-14 Tom Tromey <tromey@cygnus.com> * jcf-write.c (write_classfile): Add output class file as target. diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 926d7e3..7006815 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -507,6 +507,20 @@ extern void push_labeled_block PROTO ((tree)); extern tree prepare_eh_table_type PROTO ((tree)); extern void java_set_exception_lang_code PROTO (()); extern tree generate_name PROTO ((void)); +extern void pop_labeled_block PROTO (()); +extern char *lang_printable_name PROTO ((tree, int)); +extern tree maybe_add_interface PROTO ((tree, tree)); +extern void set_super_info PROTO ((int, tree, tree, int)); +extern int get_access_flags_from_decl PROTO ((tree)); +extern int interface_of_p PROTO ((tree, tree)); +extern int inherits_from_p PROTO ((tree, tree)); +extern void fix_classpath PROTO (()); +extern void complete_start_java_method PROTO ((tree)); +extern void emit_handlers PROTO (()); +extern void init_outgoing_cpool PROTO (()); +extern void make_class_data PROTO ((tree)); +extern void register_class PROTO (()); +extern int alloc_name_constant PROTO ((int, tree)); /* Access flags etc for a method (a FUNCTION_DECL): */ diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 3b1593c..df6c50d 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -118,7 +118,7 @@ static int dependency_tracking = 0; */ int lang_decode_option (argc, argv) - int argc; + int argc __attribute__ ((__unused__)); char **argv; { char *p = argv[0]; @@ -132,8 +132,9 @@ lang_decode_option (argc, argv) p += 2; for (j = 0; - !found && j < sizeof (lang_f_options) / sizeof (lang_f_options[0]); - j++) + !found + && j < (int)(sizeof (lang_f_options) / sizeof (lang_f_options[0])); + j++) { if (!strcmp (p, lang_f_options[j].string)) { @@ -363,7 +364,7 @@ put_decl_node (node) char * lang_printable_name (decl, v) tree decl; - int v; + int v __attribute__ ((__unused__)); { decl_bufpos = 0; put_decl_node (decl); @@ -389,7 +390,7 @@ lang_print_error (file) last_error_function_context = DECL_CONTEXT (current_function_decl); fprintf (stderr, "In class `%s':\n", - lang_printable_name (last_error_function_context)); + lang_printable_name (last_error_function_context, 0)); } if (last_error_function != current_function_decl) { @@ -451,7 +452,7 @@ lang_init () function prototypes. */ void java_dummy_print (s) - char *s; + char *s __attribute__ ((__unused__)); { } @@ -493,25 +494,25 @@ lang_identify () void print_lang_decl (file, node, indent) - FILE *file; - tree node; - int indent; + FILE *file __attribute ((__unused__)); + tree node __attribute ((__unused__)); + int indent __attribute ((__unused__)); { } void print_lang_type (file, node, indent) - FILE *file; - tree node; - int indent; + FILE *file __attribute ((__unused__)); + tree node __attribute ((__unused__)); + int indent __attribute ((__unused__)); { } void print_lang_identifier (file, node, indent) - FILE *file; - tree node; - int indent; + FILE *file __attribute ((__unused__)); + tree node __attribute ((__unused__)); + int indent __attribute ((__unused__)); { } @@ -524,8 +525,8 @@ print_lang_statistics () void lang_print_xnode (file, node, indent) - FILE *file; - tree node; - int indent; + FILE *file __attribute ((__unused__)); + tree node __attribute ((__unused__)); + int indent __attribute ((__unused__)); { } diff --git a/gcc/java/lex.c b/gcc/java/lex.c index 6ab4e4d..7caed76 100644 --- a/gcc/java/lex.c +++ b/gcc/java/lex.c @@ -36,6 +36,7 @@ Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */ #include <stdio.h> #include <string.h> +#include <strings.h> #include <setjmp.h> #ifdef JAVA_LEX_DEBUG @@ -125,8 +126,7 @@ java_sneak_unicode () } static void -java_unget_unicode (c) - unicode_t c; +java_unget_unicode () { if (!ctxp->c_line->current) fatal ("can't unget unicode - java_unget_unicode"); @@ -137,7 +137,6 @@ java_unget_unicode (c) void java_allocate_new_line () { - int i; unicode_t ahead = (ctxp->c_line ? ctxp->c_line->ahead[0] : '\0'); char ahead_escape_p = (ctxp->c_line ? ctxp->c_line->unicode_escape_ahead_p : 0); @@ -200,25 +199,26 @@ java_read_char () return UEOF; else { - if (c & 0xe0 == 0xc0) + if (c & (0xe0 == 0xc0)) { c1 = GETC (); - if (c1 & 0xc0 == 0x80) + if (c1 & (0xc0 == 0x80)) return (unicode_t)(((c &0x1f) << 6) + (c1 & 0x3f)); } - else if (c & 0xf0 == 0xe0) + else if (c & (0xf0 == 0xe0)) { c1 = GETC (); - if (c1 & 0xc0 == 0x80) + if (c1 & (0xc0 == 0x80)) { c2 = GETC (); - if (c2 & 0xc0 == 0x80) + if (c2 & (0xc0 == 0x80)) return (unicode_t)(((c & 0xf) << 12) + (( c1 & 0x3f) << 6) + (c2 & 0x3f)); } } java_lex_error ("Bad utf8 encoding", 0); } + return 0; } static void @@ -277,7 +277,7 @@ java_read_unicode (term_context, unicode_escape_p) if (c >= '0' && c <= '9') unicode |= (unicode_t)((c-'0') << shift); else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) - unicode |= (unicode_t)(10+(c | 0x20)-'a' << shift); + unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift); else java_lex_error ("Non hex digit in Unicode escape sequence", 0); @@ -364,7 +364,7 @@ java_parse_end_comment () case '/': return; case '*': /* reparse only '*' */ - java_unget_unicode (c); + java_unget_unicode (); } } } @@ -413,7 +413,7 @@ java_parse_escape_sequence () c = java_get_unicode ()) octal_escape [octal_escape_index++] = c; - java_unget_unicode (c); + java_unget_unicode (); if ((octal_escape_index == 3) && (octal_escape [0] > '3')) { @@ -448,7 +448,6 @@ java_lex (java_lval) YYSTYPE *java_lval; { unicode_t c, first_unicode; - int line_terminator; int ascii_index, all_ascii; char *string; @@ -471,7 +470,7 @@ java_lex (java_lval) if ((c = java_get_unicode ()) == UEOF) return 0; /* Ok here */ else - java_unget_unicode (c); /* Caught latter at the end the function */ + java_unget_unicode (); /* Caught latter at the end the function */ } /* Handle EOF here */ if (c == UEOF) /* Should probably do something here... */ @@ -544,7 +543,7 @@ java_lex (java_lval) java_lex_error ("Comment not terminated at end of input", 0); - java_unget_unicode (c); + java_unget_unicode (); deprecated [deprecated_index] = '\0'; if (!strcmp (deprecated, "deprecated")) { @@ -555,13 +554,13 @@ java_lex (java_lval) } } else - java_unget_unicode (c); + java_unget_unicode (); java_parse_end_comment (); goto step1; break; default: - java_unget_unicode (c); + java_unget_unicode (); c = '/'; break; } @@ -575,7 +574,6 @@ java_lex (java_lval) /* Numeric literals */ if (JAVA_ASCII_DIGIT (c) || (c == '.')) { - unicode_t peep; /* This section of code is borrowed from gcc/c-lex.c */ #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2) int parts[TOTAL_PARTS]; @@ -614,7 +612,7 @@ java_lex (java_lval) else if (c == '.') { /* Push the '.' back and prepare for a FP parsing... */ - java_unget_unicode (c); + java_unget_unicode (); c = '0'; } else @@ -635,7 +633,7 @@ java_lex (java_lval) double_type_node); return (FP_LIT_TK); default: - java_unget_unicode (c); + java_unget_unicode (); SET_LVAL_NODE_TYPE (integer_zero_node, int_type_node); return (INT_LIT_TK); } @@ -745,7 +743,7 @@ java_lex (java_lval) #endif if (stage != 4) /* Don't push back fF/dD */ - java_unget_unicode (c); + java_unget_unicode (); /* An exponent (if any) must have seen a digit. */ if (seen_exponent && !seen_digit) @@ -790,7 +788,7 @@ java_lex (java_lval) else if (radix == 16 && !literal_index) java_lex_error ("No digit specified for hexadecimal literal", 0); else - java_unget_unicode (c); + java_unget_unicode (); #ifdef JAVA_LEX_DEBUG literal_token [literal_index] = '\0'; /* So JAVA_LEX_LIT is safe. */ @@ -965,7 +963,7 @@ java_lex (java_lval) variable_declarator: rule, it has to be seen as '=' as opposed to being seen as an ordinary assignment operator in assignment_operators: rule. */ - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (ASSIGN_TK); } @@ -984,17 +982,17 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (ZRS_TK); } case '=': BUILD_OPERATOR2 (SRS_ASSIGN_TK); default: - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (SRS_TK); } default: - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (GT_TK); } @@ -1010,11 +1008,11 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (LS_TK); } default: - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (LT_TK); } @@ -1026,7 +1024,7 @@ java_lex (java_lval) case '=': BUILD_OPERATOR2 (AND_ASSIGN_TK); default: - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (AND_TK); } @@ -1038,7 +1036,7 @@ java_lex (java_lval) case '=': BUILD_OPERATOR2 (OR_ASSIGN_TK); default: - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (OR_TK); } @@ -1050,7 +1048,7 @@ java_lex (java_lval) case '=': BUILD_OPERATOR2 (PLUS_ASSIGN_TK); default: - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (PLUS_TK); } @@ -1062,7 +1060,7 @@ java_lex (java_lval) case '=': BUILD_OPERATOR2 (MINUS_ASSIGN_TK); default: - java_unget_unicode (c); + java_unget_unicode (); ctxp->minus_seen = 1; BUILD_OPERATOR (MINUS_TK); } @@ -1074,7 +1072,7 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (MULT_TK); } @@ -1085,7 +1083,7 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (DIV_TK); } @@ -1096,7 +1094,7 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (XOR_TK); } @@ -1107,7 +1105,7 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (REM_TK); } @@ -1118,7 +1116,7 @@ java_lex (java_lval) } else { - java_unget_unicode (c); + java_unget_unicode (); BUILD_OPERATOR (NEG_TK); } @@ -1144,7 +1142,7 @@ java_lex (java_lval) obstack_1grow (&temporary_obstack, '\0'); string = obstack_finish (&temporary_obstack); - java_unget_unicode (c); + java_unget_unicode (); /* If we have something all ascii, we consider a keyword, a boolean literal, a null literal or an all ASCII identifier. Otherwise, diff --git a/gcc/java/lex.h b/gcc/java/lex.h index 9116e42..155e1c3 100644 --- a/gcc/java/lex.h +++ b/gcc/java/lex.h @@ -140,6 +140,7 @@ typedef struct _java_lc { #else +extern void set_float_handler PROTO((jmp_buf)); static tree build_wfl_node (); #define SET_FLOAT_HANDLER(H) set_float_handler ((H)) #define DCONST0 dconst0 diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 09d25ba..b53eaac 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -191,12 +191,12 @@ extern tree stabilize_reference PROTO ((tree)); #define ERROR_CANT_CONVERT_TO_BOOLEAN(OPERATOR, NODE, TYPE) \ parse_error_context \ ((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \ - "boolean", operator_string ((NODE)), lang_printable_name ((TYPE))) + "boolean", operator_string ((NODE)), lang_printable_name ((TYPE),0)) #define ERROR_CANT_CONVERT_TO_NUMERIC(OPERATOR, NODE, TYPE) \ parse_error_context \ ((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \ - "numeric type", operator_string ((NODE)), lang_printable_name ((TYPE))) + "numeric type", operator_string ((NODE)), lang_printable_name ((TYPE), 0)) #define ERROR_CAST_NEEDED_TO_INTEGRAL(OPERATOR, NODE, TYPE) \ parse_error_context \ @@ -204,7 +204,7 @@ extern tree stabilize_reference PROTO ((tree)); "Incompatible type for `%s'. Explicit cast needed to convert " \ "`%s' to integral" : "Incompatible type for `%s'. Can't convert " \ "`%s' to integral"), operator_string ((NODE)), \ - lang_printable_name ((TYPE))) + lang_printable_name ((TYPE), 0)) #define ERROR_VARIABLE_NOT_INITIALIZED(WFL, V) \ parse_error_context \ @@ -560,7 +560,7 @@ static tree create_class PROTO ((int, tree, tree, tree)); static tree create_interface PROTO ((int, tree, tree)); static tree find_field PROTO ((tree, tree)); static tree lookup_field_wrapper PROTO ((tree, tree)); -static int duplicate_declaration_error PROTO ((tree, tree, tree, tree)); +static int duplicate_declaration_error PROTO ((tree, tree, tree)); static void register_fields PROTO ((int, tree, tree)); static tree parser_qualified_classname PROTO ((tree)); static int parser_check_super PROTO ((tree, tree, tree)); @@ -595,12 +595,11 @@ static tree patch_method_invocation_stmt PROTO ((tree, tree, tree, int *, tree * static int breakdown_qualified PROTO ((tree *, tree *, tree)); static tree resolve_and_layout PROTO ((tree, tree)); static tree resolve_no_layout PROTO ((tree, tree)); -static int identical_subpath_p PROTO ((tree, tree)); static int invocation_mode PROTO ((tree, int)); static tree find_applicable_accessible_methods_list PROTO ((tree, tree, tree)); static tree find_most_specific_methods_list PROTO ((tree)); static int argument_types_convertible PROTO ((tree, tree)); -static tree patch_invoke PROTO ((tree, tree, tree, tree)); +static tree patch_invoke PROTO ((tree, tree, tree)); static tree lookup_method_invoke PROTO ((int, tree, tree, tree, tree)); static tree register_incomplete_type PROTO ((int, tree, tree, tree)); static tree obtain_incomplete_type PROTO ((tree)); @@ -624,7 +623,7 @@ static tree build_unaryop PROTO ((int, int, tree)); static tree build_incdec PROTO ((int, int, tree, int)); static tree patch_unaryop PROTO ((tree, tree)); static tree build_cast PROTO ((int, tree, tree)); -static tree patch_cast PROTO ((tree, tree, tree)); +static tree patch_cast PROTO ((tree, tree)); static int valid_ref_assignconv_cast_p PROTO ((tree, tree, int)); static int valid_builtin_assignconv_identity_widening_p PROTO ((tree, tree)); static int valid_cast_to_p PROTO ((tree, tree)); @@ -658,7 +657,7 @@ static tree patch_if_else_statement PROTO ((tree)); static tree add_stmt_to_compound PROTO ((tree, tree, tree)); static tree add_stmt_to_block PROTO ((tree, tree, tree)); static tree patch_exit_expr PROTO ((tree)); -static tree build_labeled_block PROTO ((int, tree, tree)); +static tree build_labeled_block PROTO ((int, tree)); static tree generate_labeled_block PROTO (()); static tree complete_labeled_statement PROTO ((tree, tree)); static tree build_bc_statement PROTO ((int, int, tree)); @@ -680,7 +679,7 @@ static tree patch_try_statement PROTO ((tree)); static tree patch_synchronized_statement PROTO ((tree, tree)); static tree patch_throw_statement PROTO ((tree, tree)); static void check_thrown_exceptions PROTO ((int, tree)); -static int check_thrown_exceptions_do PROTO ((int, tree)); +static int check_thrown_exceptions_do PROTO ((tree)); static void purge_unchecked_exceptions PROTO ((tree)); static void check_throws_clauses PROTO ((tree, tree, tree)); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index ebca948..4bd843f 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -51,6 +51,7 @@ definitions and other extensions. */ #include <stdlib.h> #include <string.h> #include <dirent.h> +#include <setjmp.h> /* set_float_handler argument uses it */ #ifdef __STDC__ #include <stdarg.h> #else @@ -61,6 +62,7 @@ definitions and other extensions. */ #include "tree.h" #include "rtl.h" #include "obstack.h" +#include "toplev.h" #include "flags.h" #include "java-tree.h" #include "jcf.h" @@ -573,8 +575,6 @@ field_declaration: { register_fields (0, $1, $2); } | modifiers type variable_declarators SC_TK { - int acc_count = 0; - check_modifiers ("Illegal modifier `%s' for field declaration", $1, FIELD_MODIFIERS); @@ -1041,7 +1041,7 @@ label_decl: identifier REL_CL_TK { $$ = build_labeled_block (EXPR_WFL_LINECOL ($1), - EXPR_WFL_NODE ($1), $1); + EXPR_WFL_NODE ($1)); pushlevel (2); push_labeled_block ($$); PUSH_LABELED_BLOCK ($$); @@ -2120,7 +2120,7 @@ java_pop_parser_context () IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_PURPOSE (current)) = 0; /* And restore those of the previous context */ - if (ctxp = next) + if ((ctxp = next)) /* Assignment is really meant here */ for (current = ctxp->import_list; current; current = TREE_CHAIN (current)) IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_PURPOSE (current)) = 1; @@ -2148,7 +2148,7 @@ yyerror (msg) static int prev_lineno; static char *prev_msg; - int i, save_lineno; + int save_lineno; char *remainder, *code_from_source; extern struct obstack temporary_obstack; @@ -2332,7 +2332,7 @@ variable_redefinition_error (context, name, type, line) if (TREE_CODE (type) == TREE_LIST) type_name = IDENTIFIER_POINTER (TYPE_NAME (TREE_PURPOSE (type))); else - type_name = (char *)lang_printable_name (type); + type_name = lang_printable_name (type, 0); parse_error_context (context, "Variable `%s' is already defined in this method and " @@ -2525,7 +2525,6 @@ create_interface (flags, id, super) int flags; tree id, super; { - int chk; tree raw_name = EXPR_WFL_NODE (id); tree q_name = parser_qualified_classname (id); tree decl = IDENTIFIER_CLASS_VALUE (q_name); @@ -2572,7 +2571,6 @@ create_class (flags, id, super, interfaces) int flags; tree id, super, interfaces; { - int chk; tree raw_name = EXPR_WFL_NODE (id); tree class_id, decl; tree super_decl = NULL, super_decl_type; @@ -2666,20 +2664,20 @@ lookup_field_wrapper (class, name) the error */ static int -duplicate_declaration_error (class, new_field_name, new_type, cl) - tree class, new_field_name, new_type, cl; +duplicate_declaration_error (new_field_name, new_type, cl) + tree new_field_name, new_type, cl; { /* This might be modified to work with method decl as well */ tree decl = find_field (TREE_TYPE (ctxp->current_parsed_class), new_field_name); if (decl) { - char *t1 = strdup ((char *)lang_printable_name (new_type, 1)); + char *t1 = strdup (lang_printable_name (new_type, 1)); char *t2 = strdup ((TREE_CODE (TREE_TYPE (decl)) == TREE_LIST ? IDENTIFIER_POINTER (TYPE_NAME (TREE_PURPOSE (TREE_TYPE (decl)))) : - (char *)lang_printable_name (TREE_TYPE (decl), 1))); + lang_printable_name (TREE_TYPE (decl), 1))); parse_error_context (cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)", t1, IDENTIFIER_POINTER (new_field_name), @@ -2701,7 +2699,7 @@ register_fields (flags, type, variable_list) int flags; tree type, variable_list; { - tree current, type_decl, returned_type; + tree current, returned_type; tree class_type = TREE_TYPE (ctxp->current_parsed_class); int saved_lineno = lineno; int must_chain = 0; @@ -2744,7 +2742,7 @@ register_fields (flags, type, variable_list) tree init = TREE_VALUE (current); tree current_name = EXPR_WFL_NODE (cl); - if (duplicate_declaration_error (class_type, current_name, type, cl)) + if (duplicate_declaration_error (current_name, type, cl)) { tree field_decl; lineno = EXPR_WFL_LINENO (cl); @@ -2864,7 +2862,6 @@ method_header (flags, type, mdecl, throws) tree meth = TREE_VALUE (mdecl); tree id = TREE_PURPOSE (mdecl); tree this_class = TREE_TYPE (ctxp->current_parsed_class); - tree handle_class = CLASS_TO_HANDLE_TYPE (this_class); tree meth_name, returned_type, current; int saved_lineno; @@ -3051,7 +3048,6 @@ method_declarator (id, list) tree arg_types = NULL_TREE, current, node; tree meth = make_node (FUNCTION_TYPE); jdep *jdep; - int incomplete = 0; patch_stage = JDEP_NO_PATCH; @@ -3060,8 +3056,7 @@ method_declarator (id, list) tree wfl_name = TREE_PURPOSE (current); tree type = TREE_VALUE (current); tree name = EXPR_WFL_NODE (wfl_name); - tree patchable_type = NULL_TREE, already; - tree arg_node, returned_type; + tree already, arg_node, returned_type; /* Check redefinition */ for (already = arg_types; already; already = TREE_CHAIN (already)) @@ -3172,7 +3167,6 @@ static int parser_check_super (super_decl, this_decl, wfl) tree super_decl, this_decl, wfl; { - tree this_type = TREE_TYPE (this_decl); tree super_type = TREE_TYPE (super_decl); /* SUPER should be a CLASS (neither an array nor an interface) */ @@ -3369,7 +3363,6 @@ jdep_resolve_class (dep) void java_complete_class () { - tree current; tree cclass; jdeplist *cclassd; int error_found; @@ -3506,7 +3499,8 @@ java_complete_class () break; default: - fatal ("incomplete switch - java_complete_class"); + fatal ("Can't handle patch code %d - java_complete_class", + JDEP_KIND (dep)); } } } @@ -3718,6 +3712,10 @@ complete_class_report_errors (dep) (JDEP_WFL (dep), "Class `%s' not found in `throws'", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))); break; + default: + /* Fix for -Wall. Just break doing nothing. The error will be + caught later */ + break; } } @@ -3803,12 +3801,12 @@ java_check_regular_methods (class_decl) types. */ if (TREE_TYPE (TREE_TYPE (found)) != TREE_TYPE (TREE_TYPE (method))) { - char *t = strdup ((char *)lang_printable_name (TREE_TYPE - (TREE_TYPE (found)))); + char *t = strdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), + 0)); parse_error_context (method_wfl, "Method `%s' was defined with return type `%s' in class `%s'", - lang_printable_name (found), t, + lang_printable_name (found, 0), t, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); @@ -3824,7 +3822,7 @@ java_check_regular_methods (class_decl) (method_wfl, "%s methods can't be overriden. Method `%s' is %s in class `%s'", (METHOD_FINAL (found) ? "Final" : "Static"), - lang_printable_name (found), + lang_printable_name (found, 0), (METHOD_FINAL (found) ? "final" : "static"), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); @@ -3837,7 +3835,7 @@ java_check_regular_methods (class_decl) (method_wfl, "Instance methods can't be overriden by a static method. Method " "`%s' is an instance method in class `%s'", - lang_printable_name (found), + lang_printable_name (found, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); continue; @@ -3851,7 +3849,7 @@ java_check_regular_methods (class_decl) parse_error_context (method_wfl, "Methods can't be overridden to be more private. Method `%s' is " - "%s in class `%s'", lang_printable_name (found), + "%s in class `%s'", lang_printable_name (found, 0), (METHOD_PUBLIC (found) ? "public" : "protected"), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); @@ -3872,7 +3870,7 @@ java_check_regular_methods (class_decl) (method_wfl, "Method `%s' in class `%s' does not " "override the corresponding method in class `%s', which is " "private to a different package", - lang_printable_name (found), + lang_printable_name (found, 0), IDENTIFIER_POINTER (DECL_NAME (class_decl)), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); @@ -3925,7 +3923,7 @@ check_throws_clauses (method, method_wfl, found) "`throws' clause. The exception must be a subclass of an " "exception thrown by `%s' from class `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows)))), - lang_printable_name (found), + lang_printable_name (found, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } @@ -3943,7 +3941,6 @@ java_check_abstract_methods (interface) for (method = TYPE_METHODS (interface); method; method = TREE_CHAIN (method)) { - char *csig; tree method_wfl = DECL_NAME (method); /* 2- Check for double definition inside the defining interface */ @@ -3955,12 +3952,12 @@ java_check_abstract_methods (interface) found = lookup_java_interface_method2 (interface, method); if (found) { - char *t = strdup ((char *)lang_printable_name (TREE_TYPE - (TREE_TYPE (found)))); + char *t = strdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), + 0)); parse_error_context (method_wfl, "Method `%s' was defined with return type `%s' in class `%s ", - lang_printable_name (found), t, + lang_printable_name (found, 0), t, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); @@ -3992,7 +3989,7 @@ java_check_abstract_methods (interface) "method is redefined with a different return " "type in interface `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (interface))), - lang_printable_name (found), + lang_printable_name (found, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (sub_interface_method)))), IDENTIFIER_POINTER @@ -4234,6 +4231,8 @@ read_import_entry (jcf, dirp, returned_name) return (zipd->filename_length - current_entry_len); } } + *returned_name = NULL; + return 0; } } @@ -4248,10 +4247,8 @@ read_import_dir (wfl) char *name = IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl)); int name_len = IDENTIFIER_LENGTH (EXPR_WFL_NODE (wfl)), reclen; DIR *dirp = NULL; - tree dirname = ident_subst (name, name_len, "", '.', '/', ""); JCF jcfr, *jcf, *saved_jcf = current_jcf; char *founddirname, *d_name; - struct ZipFileCache zip_cache; jcf = &jcfr; if (!classpath) @@ -4310,7 +4307,7 @@ read_import_dir (wfl) if (java_or_class) { char *id_name; - tree node, old; + tree node; obstack_grow (&temporary_obstack, name, name_len); obstack_1grow (&temporary_obstack, '/'); @@ -4343,7 +4340,6 @@ find_in_imports_on_demand (class_type) for (import = ctxp->import_demand_list; import; import = TREE_CHAIN (import)) { char *id_name; - tree found; obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (TREE_PURPOSE (import))), IDENTIFIER_LENGTH (EXPR_WFL_NODE (TREE_PURPOSE (import)))); @@ -4406,7 +4402,6 @@ check_pkg_class_access (class_name, cl) tree cl; { tree type; - int access; if (!QUALIFIED_P (class_name) || !IDENTIFIER_CLASS_VALUE (class_name)) return 0; @@ -4434,7 +4429,7 @@ declare_local_variables (modifier, type, vlist) tree type; tree vlist; { - tree decl, current, returned_type, type_wfl, init_stmt = NULL_TREE; + tree decl, current, returned_type, type_wfl; int must_chain = 0; /* Push a new block if statement were seen between the last time we @@ -4496,7 +4491,6 @@ declare_local_variables (modifier, type, vlist) /* Add the initialization function to the current function's code */ if (init) { - tree wfl; MODIFY_EXPR_FROM_INITIALIZATION_P (init) = 1; java_method_add_stmt (current_function_decl, @@ -4525,7 +4519,6 @@ source_start_java_method (fndecl) tree parm_decl; int i; - extern tree current_binding_level; current_function_decl = fndecl; /* New scope for the function */ @@ -4568,9 +4561,7 @@ expand_start_java_method (fndecl) tree fndecl; { tree tem, *ptr; - tree parm_decl; - extern tree current_binding_level; current_function_decl = fndecl; announce_function (fndecl); @@ -4718,10 +4709,8 @@ java_complete_expand_methods () for (current = ctxp->class_list; current; current = TREE_CHAIN (current)) { - extern tree current_constant_pool_data_ref; tree class_type = CLASS_TO_HANDLE_TYPE (TREE_TYPE (current)); tree decl; - int saved_lineno; current_class = TREE_TYPE (current); @@ -4771,8 +4760,6 @@ static void java_complete_expand_method (mdecl) tree mdecl; { - tree node; - jdep *current; int no_ac_found = 1; /* We generate some code for an empty constructor */ @@ -4924,7 +4911,6 @@ make_qualified_name (left, right, location) tree left, right; int location; { - int qualified; tree left_id = EXPR_WFL_NODE (left); tree right_id = EXPR_WFL_NODE (right); tree wfl, merge; @@ -5169,6 +5155,10 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found) return 1; type = QUAL_DECL_TYPE (decl); continue; + + default: + /* Fix for -Wall Just go to the next statement. Don't + continue */ } /* If we fall here, we weren't processing a (static) function call. */ @@ -5220,7 +5210,7 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found) ((from_cast ? qual_wfl : wfl), "No variable `%s' defined in class `%s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), - lang_printable_name (type)); + lang_printable_name (type, 0)); else parse_error_context (qual_wfl, "Undefined variable or class name: `%s'", @@ -5278,7 +5268,7 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found) parse_error_context (qual_wfl, "Attempt to reference field `%s' in `%s %s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), - lang_printable_name (type), + lang_printable_name (type, 0), IDENTIFIER_POINTER (DECL_NAME (field_decl))); return 1; } @@ -5431,7 +5421,7 @@ class_in_current_package (class) qualified, class isn't in the current package. If there is a current package and the name of the CLASS is not qualified, class isn't in the current package */ - if (!ctxp->package && qualified_flag || ctxp->package && !qualified_flag) + if ((!ctxp->package && qualified_flag) || (ctxp->package && !qualified_flag)) return 0; /* If there is not package and the name of CLASS isn't qualified, @@ -5539,12 +5529,12 @@ patch_method_invocation_stmt (patch, primary, where, is_static, ret_decl) list = lookup_method_invoke (0, wfl, type, identifier, args); if (list && !METHOD_STATIC (list)) { - char *fct_name = strdup ((char *)lang_printable_name (list)); + char *fct_name = strdup (lang_printable_name (list, 0)); parse_error_context (identifier_wfl, "Can't make static reference to method `%s %s' in class `%s'", - lang_printable_name (TREE_TYPE (TREE_TYPE (list))), fct_name, - IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); + lang_printable_name (TREE_TYPE (TREE_TYPE (list)), 0), + fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); free (fct_name); PATCH_METHOD_RETURN_ERROR (); } @@ -5650,11 +5640,11 @@ patch_method_invocation_stmt (patch, primary, where, is_static, ret_decl) return the call */ if (not_accessible_p (class_type, list, 0)) { - char *fct_name = strdup ((char *)lang_printable_name (list)); + char *fct_name = strdup (lang_printable_name (list, 0)); parse_error_context (wfl, "Can't access %s method `%s %s.%s' from `%s'", java_accstring_lookup (get_access_flags_from_decl (list)), - lang_printable_name (TREE_TYPE (TREE_TYPE (list))), + lang_printable_name (TREE_TYPE (TREE_TYPE (list)), 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class_type))), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); free (fct_name); @@ -5668,7 +5658,7 @@ patch_method_invocation_stmt (patch, primary, where, is_static, ret_decl) EH checking */ if (ret_decl) *ret_decl = list; - return patch_invoke (patch, list, args, wfl); + return patch_invoke (patch, list, args); } /* Check that we're not trying to do a static reference to a method in @@ -5681,10 +5671,10 @@ check_for_static_method_reference (wfl, node, method, where, primary) if (METHOD_STATIC (current_function_decl) && !METHOD_STATIC (method) && !primary && !CALL_CONSTRUCTOR_P (node)) { - char *fct_name = strdup ((char *)lang_printable_name (method)); + char *fct_name = strdup (lang_printable_name (method, 0)); parse_error_context (wfl, "Can't make static reference to method `%s %s' in class `%s'", - lang_printable_name (TREE_TYPE (TREE_TYPE (method))), fct_name, + lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (where)))); free (fct_name); return 1; @@ -5696,14 +5686,13 @@ check_for_static_method_reference (wfl, node, method, where, primary) mode. */ static tree -patch_invoke (patch, method, args, cl) +patch_invoke (patch, method, args) tree patch, method, args; - tree cl; { int im; tree dtable, func; tree signature = build_java_signature (TREE_TYPE (method)); - tree original_call, node, t, ta; + tree original_call, t, ta; /* Last step for args: convert build-in types */ for (t = TYPE_ARG_TYPES (TREE_TYPE (method)), @@ -5799,7 +5788,7 @@ lookup_method_invoke (lc, cl, class, name, arg_list) { tree method = make_node (FUNCTION_TYPE); tree arg_type_list = NULL_TREE; - tree signature, list, node, scratch; + tree signature, list, node; char *candidates; /* Used for error report */ for (node = arg_list; node; node = TREE_CHAIN (node)) @@ -6041,6 +6030,10 @@ qualify_ambiguous_name (id) case ARRAY_REF: qual_wfl = TREE_OPERAND (qual_wfl, 0); break; + + default: + /* Fix for -Wall. Just break doing nothing */ + break; } name = EXPR_WFL_NODE (qual_wfl); ptr_type = current_class; @@ -6167,23 +6160,6 @@ breakdown_qualified (left, right, source) return 0; } -/* Return 1 if N1 and N2 have identical sub-path. */ - -static int -identical_subpath_p (n1, n2) - tree n1, n2; -{ - tree left1, left2; - - if (!QUALIFIED_P (n1) || !QUALIFIED_P (n2)) - return n1 == n2; - - breakdown_qualified (&left1, NULL, n1); - breakdown_qualified (&left2, NULL, n2); - - return left1 == left2; -} - static int not_initialized_as_it_should_p (decl) tree decl; @@ -6773,10 +6749,9 @@ patch_assignment (node, wfl_op1, wfl_op2) tree wfl_op1; tree wfl_op2; { - tree rhs = TREE_OPERAND (node, 1), temp; + tree rhs = TREE_OPERAND (node, 1); tree lvalue = TREE_OPERAND (node, 0); tree lhs_type, rhs_type, new_rhs = NULL_TREE; - int all_primitive; int error_found = 0; int lvalue_from_array = 0; @@ -6819,12 +6794,10 @@ patch_assignment (node, wfl_op1, wfl_op2) rhs_type = TREE_TYPE (rhs); /* 5.1 Try the assignment conversion for builtin type. */ - if ((new_rhs = try_builtin_assignconv (wfl_op1, lhs_type, rhs))) - ; + new_rhs = try_builtin_assignconv (wfl_op1, lhs_type, rhs); /* 5.2 If it failed, try a reference conversion */ - if (!new_rhs && - (new_rhs = try_reference_assignconv (lhs_type, rhs))) + if (!new_rhs && (new_rhs = try_reference_assignconv (lhs_type, rhs))) lhs_type = promote_type (rhs_type); /* 15.25.2 If we have a compound assignment, convert RHS into the @@ -6835,8 +6808,8 @@ patch_assignment (node, wfl_op1, wfl_op2) /* Explicit cast required. This is an error */ if (!new_rhs) { - char *t1 = strdup ((char *)lang_printable_name (TREE_TYPE (rhs))); - char *t2 = strdup ((char *)lang_printable_name (lhs_type)); + char *t1 = strdup (lang_printable_name (TREE_TYPE (rhs), 0)); + char *t2 = strdup (lang_printable_name (lhs_type, 0)); tree wfl; char operation [32]; /* Max size known */ @@ -6953,7 +6926,7 @@ try_builtin_assignconv (wfl_op1, lhs_type, rhs) parse_warning_context (wfl_op1, "Constant expression `%s' to wide for narrowing " "primitive conversion to `%s'", - print_int_node (rhs), lang_printable_name (lhs_type)); + print_int_node (rhs), lang_printable_name (lhs_type, 0)); /* Reported a warning that will turn into an error further down, so we don't return */ } @@ -7017,7 +6990,7 @@ valid_ref_assignconv_cast_p (source, dest, cast) { if (TYPE_CLASS_P (dest)) return source == dest || inherits_from_p (source, dest) - || cast && inherits_from_p (dest, source); + || (cast && inherits_from_p (dest, source)); if (TYPE_INTERFACE_P (dest)) { /* If doing a cast and SOURCE is final, the operation is @@ -7054,7 +7027,7 @@ valid_ref_assignconv_cast_p (source, dest, cast) { tree method_source, method_dest; tree source_type; - tree source_sig, dest_sig; + tree source_sig; tree source_name; for (method_source = TYPE_METHODS (source); method_source; method_source = TREE_CHAIN (method_source)) @@ -7146,7 +7119,7 @@ build_binop (op, op_location, op1, op2) int op_location; tree op1, op2; { - tree wfl, binop, merge; + tree binop; binop = build (op, NULL_TREE, op1, op2); TREE_SIDE_EFFECTS (binop) = 1; @@ -7323,7 +7296,7 @@ patch_binop (node, wfl_op1, wfl_op2) "shift distance from `%s' to integral" : "Incompatible type for `%s'. Can't convert shift distance from " "`%s' to integral"), - operator_string (node), lang_printable_name (op2_type)); + operator_string (node), lang_printable_name (op2_type, 0)); TREE_TYPE (node) = error_mark_node; error_found = 1; break; @@ -7449,11 +7422,11 @@ patch_binop (node, wfl_op1, wfl_op2) else { char *t1; - t1 = strdup ((char *)lang_printable_name (op1_type)); + t1 = strdup (lang_printable_name (op1_type, 0)); parse_error_context (wfl_operator, "Incompatible type for `%s'. Can't convert `%s' " "to `%s'", operator_string (node), t1, - lang_printable_name (op2_type)); + lang_printable_name (op2_type, 0)); free (t1); TREE_TYPE (node) = boolean_type_node; error_found = 1; @@ -7564,7 +7537,7 @@ string_constant_concatenation (op1, op2) { if (TREE_CODE (op1) == STRING_CST || (TREE_CODE (op2) == STRING_CST)) { - tree string, rest, result; + tree string, rest; int invert; string = (TREE_CODE (op1) == STRING_CST ? op1 : op2); @@ -7785,7 +7758,7 @@ patch_unaryop (node, wfl_op) { parse_error_context (wfl_op, "Invalid argument type `%s' to `%s'", - lang_printable_name (op_type), operator_string (node)); + lang_printable_name (op_type, 0), operator_string (node)); TREE_TYPE (node) = error_mark_node; error_found = 1; } @@ -7850,7 +7823,7 @@ patch_unaryop (node, wfl_op) /* 15.15 Cast Expression */ case CONVERT_EXPR: - value = patch_cast (node, wfl_op, wfl_operator); + value = patch_cast (node, wfl_operator); if (value == error_mark_node) { TREE_TYPE (node) = error_mark_node; @@ -7906,9 +7879,8 @@ resolve_type_during_patch (type) found. Otherwise NODE or something meant to replace it is returned. */ static tree -patch_cast (node, wfl_op, wfl_operator) +patch_cast (node, wfl_operator) tree node; - tree wfl_op; tree wfl_operator; { tree op = TREE_OPERAND (node, 0); @@ -7956,9 +7928,9 @@ patch_cast (node, wfl_op, wfl_operator) } /* Any other casts are proven incorrect at compile time */ - t1 = strdup ((char *)lang_printable_name (op_type)); + t1 = strdup (lang_printable_name (op_type, 0)); parse_error_context (wfl_operator, "Invalid cast from `%s' to `%s'", - t1, lang_printable_name (cast_type)); + t1, lang_printable_name (cast_type, 0)); free (t1); return error_mark_node; } @@ -8004,7 +7976,7 @@ patch_array_ref (node, wfl_array, wfl_index) { parse_error_context (wfl_operator, "`[]' can only be applied to arrays. It can't be " - "applied to `%s'", lang_printable_name (array_type)); + "applied to `%s'", lang_printable_name (array_type, 0)); TREE_TYPE (node) = error_mark_node; error_found = 1; } @@ -8020,7 +7992,7 @@ patch_array_ref (node, wfl_array, wfl_index) (could_cast ? "Incompatible type for `[]'. Explicit cast needed to " "convert `%s' to `int'" : "Incompatible type for `[]'. " "Can't convert `%s' to `int'"), - lang_printable_name (index_type)); + lang_printable_name (index_type, 0)); TREE_TYPE (node) = error_mark_node; error_found = 1; } @@ -8107,7 +8079,7 @@ patch_newarray (node) "%s convert `%s' to `int'", (valid_cast_to_p (TREE_TYPE (dim), int_type_node) ? "Explicit cast needed to" : "Can't"), - lang_printable_name (TREE_TYPE (dim))); + lang_printable_name (TREE_TYPE (dim), 0)); error_found = 1; } @@ -8241,10 +8213,10 @@ patch_return (node) if (error_found) { - char *t = strdup ((char *)lang_printable_name (mtype)); + char *t = strdup (lang_printable_name (mtype, 0)); parse_error_context (wfl_operator, "`return' with%s value from `%s %s'", (error_found == 1 ? "" : "out"), t, - lang_printable_name (meth)); + lang_printable_name (meth, 0)); free (t); return error_mark_node; } @@ -8302,7 +8274,7 @@ patch_if_else_statement (node) parse_error_context (wfl_operator, "Incompatible type for `if'. Can't convert `%s' to `boolean'", - lang_printable_name (TREE_TYPE (expression))); + lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } @@ -8318,9 +8290,9 @@ patch_if_else_statement (node) label, yet. */ static tree -build_labeled_block (location, label, wfl) +build_labeled_block (location, label) int location; - tree label, wfl; + tree label; { tree label_name = merge_qualified_name (label_id, label); tree label_decl, node; @@ -8355,7 +8327,7 @@ build_labeled_block (location, label, wfl) static tree generate_labeled_block () { - return build_labeled_block (0, generate_name (), NULL_TREE); + return build_labeled_block (0, generate_name ()); } /* A labeled statement LBE is attached a statement. */ @@ -8421,7 +8393,7 @@ build_loop_body (location, condition, reversed) tree condition; int reversed; { - tree first, second, label, body; + tree first, second, body; condition = build (EXIT_EXPR, NULL_TREE, condition); /* Force walk */ EXPR_WFL_LINECOL (condition) = location; /* For accurate error report */ @@ -8486,7 +8458,7 @@ static tree patch_loop_statement (loop) tree loop; { - tree cbl, loop_label, to_return_as_loop; + tree loop_label, to_return_as_loop; if (LOOP_HAS_LABEL_P (loop)) { @@ -8652,7 +8624,7 @@ patch_exit_expr (node) (wfl_operator, "Incompatible type for loop conditional. Can't convert `%s' to " "`boolean'", - lang_printable_name (TREE_TYPE (expression))); + lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } /* Now we know things are allright, invert the condition, fold and @@ -8683,7 +8655,7 @@ patch_switch_statement (node) EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); parse_error_context (wfl_operator, "Incompatible type for `switch'. " "Can't convert `%s' to `int'", - lang_printable_name (se_type)); + lang_printable_name (se_type, 0)); /* This is what java_complete_tree will check */ TREE_OPERAND (node, 0) = error_mark_node; return error_mark_node; @@ -8748,7 +8720,7 @@ patch_switch_statement (node) parse_error_context (wfl_operator, "Incompatible type for case. Can't convert `%s' to `int'", - lang_printable_name (TREE_TYPE (case_expr))); + lang_printable_name (TREE_TYPE (case_expr), 0)); error_found = 1; break; } @@ -8785,9 +8757,9 @@ patch_switch_statement (node) dependant things, but they rely on gcc routines. This function is placed here because it uses things defined locally in parse.y. */ -static tree -case_identity (t, v) - tree t, v; +static tree case_identity (t, v) + tree t __attribute__ ((__unused__)); + tree v; { return v; } @@ -9017,7 +8989,7 @@ patch_try_statement (node) "Can't catch class `%s'. Catch clause " "parameter type must be a subclass of " "class `java.lang.Throwable'", - lang_printable_name (carg_type)); + lang_printable_name (carg_type, 0)); error_found = 1; continue; } @@ -9104,7 +9076,7 @@ patch_synchronized_statement (node, wfl_op1) SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); parse_error_context (wfl_operator, "Incompatible type for `synchronized'" ". Can't convert `%s' to `java.lang.Object'", - lang_printable_name (TREE_TYPE (expr))); + lang_printable_name (TREE_TYPE (expr), 0)); return error_mark_node; } @@ -9165,7 +9137,7 @@ patch_throw_statement (node, wfl_op1) SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); parse_error_context (wfl_operator, "Can't throw `%s'; it must be a " "subclass of class `java.lang.Throwable'", - lang_printable_name (type)); + lang_printable_name (type, 0)); /* If the thrown expression was a reference, we further the compile-time check. */ if (!JREFERENCE_TYPE_P (type)) @@ -9187,8 +9159,7 @@ patch_throw_statement (node, wfl_op1) SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); if (!unchecked_ok) tryblock_throws_ok = - check_thrown_exceptions_do (EXPR_WFL_LINECOL (wfl_operator), - TREE_TYPE (expr)); + check_thrown_exceptions_do (TREE_TYPE (expr)); if (!(unchecked_ok || tryblock_throws_ok)) { /* If there is a surrounding try block that has no matching @@ -9199,21 +9170,21 @@ patch_throw_statement (node, wfl_op1) parse_error_context (wfl_operator, "Checked exception `%s' can't be " "caught by any of the catch clause(s) " "of the surrounding `try' block", - lang_printable_name (type)); + lang_printable_name (type, 0)); /* If we have no surrounding try statement and the method doesn't have any throws, report it now. FIXME */ else if (!EXCEPTIONS_P (currently_caught_type_list) && !tryblock_throws_ok) parse_error_context (wfl_operator, "Checked exception `%s' isn't " "thrown from a `try' block", - lang_printable_name (type)); + lang_printable_name (type, 0)); /* Otherwise, the current method doesn't have the appropriate throws declaration */ else parse_error_context (wfl_operator, "Checked exception `%s' doesn't " "match any of current method's `throws' " "declaration(s)", - lang_printable_name (type)); + lang_printable_name (type, 0)); return error_mark_node; } @@ -9238,13 +9209,13 @@ check_thrown_exceptions (location, decl) /* For all the unchecked exceptions thrown by DECL */ for (throws = DECL_FUNCTION_THROWS (decl); throws; throws = TREE_CHAIN (throws)) - if (!check_thrown_exceptions_do (location, TREE_VALUE (throws))) + if (!check_thrown_exceptions_do (TREE_VALUE (throws))) { EXPR_WFL_LINECOL (wfl_operator) = location; parse_error_context (wfl_operator, "Exception `%s' must be caught, or it must be " "declared in the `throws' clause of `%s'", - lang_printable_name (TREE_VALUE (throws)), + lang_printable_name (TREE_VALUE (throws), 0), IDENTIFIER_POINTER (DECL_NAME (current_function_decl))); } } @@ -9254,8 +9225,7 @@ check_thrown_exceptions (location, decl) current method. */ static int -check_thrown_exceptions_do (location, exception) - int location; +check_thrown_exceptions_do (exception) tree exception; { tree list = currently_caught_type_list; |