diff options
author | DJ Delorie <dj@redhat.com> | 2005-04-23 17:29:07 -0400 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2005-04-23 17:29:07 -0400 |
commit | d4ee4d252515ac2d2bdb8ed085edc7feaf5b943d (patch) | |
tree | 754eeef62542ff45392c946c655cc40c38bd1bed /gcc/java | |
parent | 6084512671ee4909d6428506d46d09ee1a90cbdf (diff) | |
download | gcc-d4ee4d252515ac2d2bdb8ed085edc7feaf5b943d.zip gcc-d4ee4d252515ac2d2bdb8ed085edc7feaf5b943d.tar.gz gcc-d4ee4d252515ac2d2bdb8ed085edc7feaf5b943d.tar.bz2 |
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/class.c | 6 | ||||
-rw-r--r-- | gcc/java/decl.c | 10 | ||||
-rw-r--r-- | gcc/java/expr.c | 16 | ||||
-rw-r--r-- | gcc/java/jcf-io.c | 2 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 8 | ||||
-rw-r--r-- | gcc/java/jv-scan.c | 16 | ||||
-rw-r--r-- | gcc/java/parse.y | 2 |
8 files changed, 41 insertions, 24 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index f5d39eb..251b8b5 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2005-04-23 DJ Delorie <dj@redhat.com> + + * class.c, decl.c, expr.c, jcf-io.c, jcf-parse.c, jv-scan.c, + parse.y: Adjust warning() callers. + 2005-04-21 Bryce McKinlay <mckinlay@redhat.com> * gcj.texi (Object fields): Change "Integer" to "Int" in example diff --git a/gcc/java/class.c b/gcc/java/class.c index 81ba75d..54e310d 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -788,9 +788,9 @@ void set_constant_value (tree field, tree constant) { if (field == NULL_TREE) - warning ("misplaced ConstantValue attribute (not in any field)"); + warning (0, "misplaced ConstantValue attribute (not in any field)"); else if (DECL_INITIAL (field) != NULL_TREE) - warning ("duplicate ConstantValue attribute for field '%s'", + warning (0, "duplicate ConstantValue attribute for field '%s'", IDENTIFIER_POINTER (DECL_NAME (field))); else { @@ -1417,7 +1417,7 @@ get_dispatch_table (tree type, tree this_class_addr) if (METHOD_ABSTRACT (method)) { if (! abstract_p) - warning ("%Jabstract method in non-abstract class", method); + warning (0, "%Jabstract method in non-abstract class", method); if (TARGET_VTABLE_USES_DESCRIPTORS) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j) diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 197c391..2feac35 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1346,7 +1346,7 @@ pushdecl (tree x) warnstring = "declaration of %qs shadows global declaration"; if (warnstring) - warning (warnstring, IDENTIFIER_POINTER (name)); + warning (0, warnstring, IDENTIFIER_POINTER (name)); } #endif @@ -1649,7 +1649,7 @@ poplevel (int keep, int reverse, int functionbody) define_label (input_location, DECL_NAME (label)); } else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label)) - warning ("%Jlabel '%D' defined but not used", label, label); + warning (0, "%Jlabel '%D' defined but not used", label, label); IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0; /* Put the labels into the "variables" of the @@ -1777,7 +1777,7 @@ force_poplevels (int start_pc) while (current_binding_level->start_pc > start_pc) { if (pedantic && current_binding_level->start_pc > start_pc) - warning ("%JIn %D: overlapped variable and exception ranges at %d", + warning (0, "%JIn %D: overlapped variable and exception ranges at %d", current_function_decl, current_function_decl, current_binding_level->start_pc); poplevel (1, 0, 0); @@ -1841,7 +1841,7 @@ give_name_to_locals (JCF *jcf) DECL_NAME (decl) = name; SET_DECL_ASSEMBLER_NAME (decl, name); if (TREE_CODE (decl) != PARM_DECL || TREE_TYPE (decl) != type) - warning ("bad type in parameter debug info"); + warning (0, "bad type in parameter debug info"); } else { @@ -1850,7 +1850,7 @@ give_name_to_locals (JCF *jcf) tree decl = build_decl (VAR_DECL, name, type); if (end_pc > DECL_CODE_LENGTH (current_function_decl)) { - warning ("%Jbad PC range for debug info for local '%D'", + warning (0, "%Jbad PC range for debug info for local '%D'", decl, decl); end_pc = DECL_CODE_LENGTH (current_function_decl); } diff --git a/gcc/java/expr.c b/gcc/java/expr.c index ee67c22..ae1055e 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -373,7 +373,7 @@ pop_type_0 (tree type, char **messagep) && t == object_ptr_type_node) { if (type != ptr_type_node) - warning ("need to insert runtime check for %s", + warning (0, "need to insert runtime check for %s", xstrdup (lang_printable_name (type, 0))); return type; } @@ -502,7 +502,7 @@ can_widen_reference_to (tree source_type, tree target_type) source_type, target_type); if (!quiet_flag) - warning ("assert: %s is assign compatible with %s", + warning (0, "assert: %s is assign compatible with %s", xstrdup (lang_printable_name (target_type, 0)), xstrdup (lang_printable_name (source_type, 0))); /* Punt everything to runtime. */ @@ -549,7 +549,7 @@ can_widen_reference_to (tree source_type, tree target_type) if (TYPE_DUMMY (source_type) || TYPE_DUMMY (target_type)) { if (! quiet_flag) - warning ("assert: %s is assign compatible with %s", + warning (0, "assert: %s is assign compatible with %s", xstrdup (lang_printable_name (target_type, 0)), xstrdup (lang_printable_name (source_type, 0))); return 1; @@ -2728,7 +2728,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index) else if (FIELD_STATIC (field_decl)) { if (!DECL_CLINIT_P (current_function_decl)) - warning ("%Jassignment to final static field %qD not in " + warning (0, "%Jassignment to final static field %qD not in " "class initializer", field_decl, field_decl); } @@ -2737,7 +2737,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index) tree cfndecl_name = DECL_NAME (current_function_decl); if (! DECL_CONSTRUCTOR_P (current_function_decl) && !ID_FINIT_P (cfndecl_name)) - warning ("%Jassignment to final field '%D' not in constructor", + warning (0, "%Jassignment to final field '%D' not in constructor", field_decl, field_decl); } } @@ -2927,7 +2927,7 @@ expand_byte_code (JCF *jcf, tree method) int pc = GET_u2 (linenumber_pointer); linenumber_pointer += 4; if (pc >= length) - warning ("invalid PC in line number table"); + warning (0, "invalid PC in line number table"); else { if ((instruction_bits[pc] & BCODE_HAS_LINENUMBER) != 0) @@ -2983,7 +2983,7 @@ expand_byte_code (JCF *jcf, tree method) { /* We've just reached the end of a region of dead code. */ if (extra_warnings) - warning ("unreachable bytecode from %d to before %d", + warning (0, "unreachable bytecode from %d to before %d", dead_code_index, PC); dead_code_index = -1; } @@ -3025,7 +3025,7 @@ expand_byte_code (JCF *jcf, tree method) { /* We've just reached the end of a region of dead code. */ if (extra_warnings) - warning ("unreachable bytecode from %d to the end of the method", + warning (0, "unreachable bytecode from %d to the end of the method", dead_code_index); } } diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index 534c45b..49d64f0 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -533,7 +533,7 @@ find_class (const char *classname, int classname_length, JCF *jcf, if (! java && ! class && java_buf.st_mtime > class_buf.st_mtime) { if (flag_newer) - warning ("source file for class %qs is newer than its matching class file. Source file %qs used instead", classname, java_buffer); + warning (0, "source file for class %qs is newer than its matching class file. Source file %qs used instead", classname, java_buffer); class = -1; } diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 2af480d..ccf6d34d 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -717,8 +717,8 @@ load_class (tree class_or_name, int verbose) { /* This is just a diagnostic during testing, not a real problem. */ if (!quiet_flag) - warning("cannot find file for class %s", - IDENTIFIER_POINTER (saved)); + warning (0, "cannot find file for class %s", + IDENTIFIER_POINTER (saved)); /* Fake it. */ if (TREE_CODE (class_or_name) == RECORD_TYPE) @@ -833,7 +833,7 @@ duplicate_class_warning (const char *filename) warn_loc.file = filename; warn_loc.line = 0; #endif - warning ("%Hduplicate class will only be compiled once", &warn_loc); + warning (0, "%Hduplicate class will only be compiled once", &warn_loc); } static void @@ -1154,7 +1154,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) free (file_list); if (filename_count == 0) - warning ("no input file specified"); + warning (0, "no input file specified"); if (resource_name) { diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c index a3726fd..fa02c59 100644 --- a/gcc/java/jv-scan.c +++ b/gcc/java/jv-scan.c @@ -42,7 +42,8 @@ Boston, MA 02111-1307, USA. */ extern void fatal_error (const char *msgid, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; -void warning (const char *msgid, ...) ATTRIBUTE_PRINTF_1; +void warning (int opt, const char *msgid, ...) ATTRIBUTE_PRINTF_2; +void warning0 (const char *msgid, ...) ATTRIBUTE_PRINTF_1; void report (void); static void usage (void) ATTRIBUTE_NORETURN; @@ -256,7 +257,18 @@ fatal_error (const char *msgid, ...) } void -warning (const char *msgid, ...) +warning (int opt ATTRIBUTE_UNUSED, const char *msgid, ...) +{ + va_list ap; + va_start (ap, msgid); + fprintf (stderr, _("%s: warning: "), exec_name); + vfprintf (stderr, _(msgid), ap); + fputc ('\n', stderr); + va_end (ap); +} + +void +warning0 (const char *msgid, ...) { va_list ap; va_start (ap, msgid); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 7410224..860725f 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -3106,7 +3106,7 @@ yyerror (const char *msgid) code_from_source, strlen (code_from_source)); remainder = obstack_finish (&temporary_obstack); if (do_warning) - warning ("%s.\n%s", msgid, remainder); + warning (0, "%s.\n%s", msgid, remainder); else error ("%s.\n%s", msgid, remainder); |