+2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * c-lex.c: Replace %H by an explicit location. Update all calls.
+ * c-common.c: Likewise.
+ * c-decl.c: Likewise.
+ * c-typeck.c: Likewise.
+ * fold-const.c: Likewise.
+ * gimplify.c: Likewise.
+ * stmt.c: Likewise.
+ * tree-cfg.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-vrp.c: Likewise.
+ * value-prof.c: Likewise.
+
2009-07-06 Diego Novillo <dnovillo@google.com>
* tree-dfa.c (dump_variable): Write DECL_INITIAL for VAR
default_node = splay_tree_lookup (cases, (splay_tree_key) NULL);
if (!default_node)
- warning (OPT_Wswitch_default, "%Hswitch missing default case",
- &switch_location);
+ warning_at (switch_location, OPT_Wswitch_default,
+ "switch missing default case");
/* From here on, we only care about about enumerated types. */
if (!type || TREE_CODE (type) != ENUMERAL_TYPE)
location_t loc = gimple_location (g);
if (fdecl)
- warning (0, "%Hignoring return value of %qD, "
- "declared with attribute warn_unused_result",
- &loc, fdecl);
+ warning_at (loc, 0, "ignoring return value of %qD, "
+ "declared with attribute warn_unused_result",
+ fdecl);
else
- warning (0, "%Hignoring return value of function "
- "declared with attribute warn_unused_result",
- &loc);
+ warning_at (loc, 0, "ignoring return value of function "
+ "declared with attribute warn_unused_result");
}
break;
if (current_function_decl == 0)
{
- error ("%H%qE undeclared here (not in a function)", &loc, id);
+ error_at (loc, "%qE undeclared here (not in a function)", id);
scope = current_scope;
}
else
{
- error ("%H%qE undeclared (first use in this function)", &loc, id);
+ error_at (loc, "%qE undeclared (first use in this function)", id);
if (!already)
{
- error ("%H(Each undeclared identifier is reported only once", &loc);
- error ("%Hfor each function it appears in.)", &loc);
+ error_at (loc, "(Each undeclared identifier is reported only once");
+ error_at (loc, "for each function it appears in.)");
already = true;
}
pending_xref_error (void)
{
if (pending_invalid_xref != 0)
- error ("%H%qE defined as wrong kind of tag",
- &pending_invalid_xref_location, pending_invalid_xref);
+ error_at (pending_invalid_xref_location, "%qE defined as wrong kind of tag",
+ pending_invalid_xref);
pending_invalid_xref = 0;
}
name = cpp_token_as_text (pfile, s);
}
- warning (OPT_Wunknown_pragmas, "%Hignoring #pragma %s %s",
- &fe_loc, space, name);
+ warning_at (fe_loc, OPT_Wunknown_pragmas, "ignoring #pragma %s %s",
+ space, name);
}
}
default:
/* ... or not. */
- error ("%Hstray %<@%> in program", &atloc);
+ error_at (atloc, "stray %<@%> in program");
*loc = newloc;
goto retry_after_at;
}
found:
if (COND_EXPR_ELSE (inner_if))
- warning (OPT_Wparentheses,
- "%Hsuggest explicit braces to avoid ambiguous %<else%>",
- &if_locus);
+ warning_at (if_locus, OPT_Wparentheses,
+ "suggest explicit braces to avoid ambiguous %<else%>");
}
stmt = build3 (COND_EXPR, void_type_node, cond, then_block, else_block);
locus = input_location;
else
locus = gimple_location (stmt);
- warning (OPT_Wstrict_overflow, "%H%s", &locus, warnmsg);
+ warning_at (locus, OPT_Wstrict_overflow, "%s", warnmsg);
}
/* Stop deferring overflow warnings, ignoring any deferred
case OMP_CLAUSE_DEFAULT_NONE:
error ("%qE not specified in enclosing parallel",
DECL_NAME (decl));
- error ("%Henclosing parallel", &ctx->location);
+ error_at (ctx->location, "enclosing parallel");
/* FALLTHRU */
case OMP_CLAUSE_DEFAULT_SHARED:
flags |= GOVD_SHARED;
+2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * jcf-parse.c: Replace %H by an explicit location. Update all calls.
+
2009-06-29 Andrew Haley <aph@redhat.com>
PR java/40590
location_t warn_loc;
linemap_add (line_table, LC_RENAME, 0, filename, 0);
warn_loc = linemap_line_start (line_table, 0, 1);
- warning (0, "%Hduplicate class will only be compiled once", &warn_loc);
+ warning_at (warn_loc, 0, "duplicate class will only be compiled once");
}
static void
+2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * objc-act.c: Replace %H by an explicit location. Update all
+ calls.
+
2009-06-22 Steven Bosscher <steven@gcc.gnu.org>
PR objc/28050
}
if (!found)
{
- location_t *loc;
+ location_t loc;
if (flag_next_runtime && TREE_PURPOSE (chain))
- loc = &DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
+ loc = DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
else
- loc = &input_location;
- warning (0, "%Hcreating selector for nonexistent method %qE",
- loc, TREE_VALUE (chain));
+ loc = input_location;
+ warning_at (loc, 0, "creating selector for nonexistent method %qE",
+ TREE_VALUE (chain));
}
}
{
warning (0, "exception of type %<%T%> will be caught",
TREE_TYPE (type));
- warning (0, "%H by earlier handler for %<%T%>",
- EXPR_LOCUS (stmt), TREE_TYPE (t ? t : objc_object_type));
+ warning_at (EXPR_LOCATION (stmt), 0, " by earlier handler for %<%T%>",
+ TREE_TYPE (t ? t : objc_object_type));
break;
}
}
return 0;
warn:
- warning (OPT_Wunused_value, "%Hvalue computed is not used", &locus);
+ warning_at (locus, OPT_Wunused_value, "value computed is not used");
return 1;
}
}
+2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * gcc.dg/plugin/selfassign.c: Replace %H by an explicit
+ location. Update all calls.
+ * g++.dg/plugin/selfassign.c: Likewise.
+
2009-07-06 Jason Merrill <jason@redhat.com>
* g++.dg/rtti/dyncast[34].C: New.
specifying LHS in the message. */
lhs = get_non_ssa_expr (lhs);
if (lhs)
- warning (0, G_("%H%qE is assigned to itself"), &location, lhs);
+ warning_at (location, 0, G_("%qE is assigned to itself"), lhs);
else
- warning (0, G_("%Hself-assignment detected"), &location);
+ warning_at (location, 0, G_("self-assignment detected"));
}
}
specifying LHS in the message. */
lhs = get_non_ssa_expr (lhs);
if (lhs)
- warning (0, G_("%H%qE is assigned to itself"), &location, lhs);
+ warning_at (location, 0, G_("%qE is assigned to itself"), lhs);
else
- warning (0, G_("%Hself-assignment detected"), &location);
+ warning_at (location, 0, G_("self-assignment detected"));
}
}
location_t loc = gimple_location (stmt);
if (LOCATION_LINE (loc) > 0)
{
- warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
+ warning_at (loc, OPT_Wunreachable_code, "will never be executed");
return true;
}
}
loop above, so the last statement we process is the first statement
in the block. */
if (loc > BUILTINS_LOCATION && LOCATION_LINE (loc) > 0)
- warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
+ warning_at (loc, OPT_Wunreachable_code, "will never be executed");
remove_phi_nodes_and_edges_for_unreachable_block (bb);
bb->il.gimple = NULL;
}
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
- warning (0, "%H%<noreturn%> function does return", &location);
+ warning_at (location, 0, "%<noreturn%> function does return");
}
/* If we see "return;" in some basic block, then we do reach the end
? N_("assuming that the loop counter does not overflow")
: N_("cannot optimize loop, the loop counter may overflow");
- if (LOCATION_LINE (loc) > 0)
- warning (OPT_Wunsafe_loop_optimizations, "%H%s", &loc, gettext (wording));
- else
- warning (OPT_Wunsafe_loop_optimizations, "%s", gettext (wording));
+ warning_at ((LOCATION_LINE (loc) > 0) ? loc : input_location,
+ OPT_Wunsafe_loop_optimizations, "%s", gettext (wording));
}
return flag_unsafe_loop_optimizations;
location = input_location;
else
location = gimple_location (stmt);
- warning (OPT_Wstrict_overflow, "%H%s", &location, warnmsg);
+ warning_at (location, OPT_Wstrict_overflow, "%s", warnmsg);
}
}
the natural range of OP0's type, then the predicate will
always fold regardless of the value of OP0. If -Wtype-limits
was specified, emit a warning. */
- const char *warnmsg = NULL;
tree type = TREE_TYPE (op0);
value_range_t *vr0 = get_value_range (op0);
&& vrp_val_is_min (vr0->min)
&& vrp_val_is_max (vr0->max)
&& is_gimple_min_invariant (op1))
- {
- if (integer_zerop (ret))
- warnmsg = G_("comparison always false due to limited range of "
- "data type");
- else
- warnmsg = G_("comparison always true due to limited range of "
- "data type");
- }
-
- if (warnmsg)
{
location_t location;
else
location = gimple_location (stmt);
- warning (OPT_Wtype_limits, "%H%s", &location, warnmsg);
+ warning_at (location, OPT_Wtype_limits,
+ integer_zerop (ret)
+ ? "comparison always false due to limited range of data type"
+ : "comparison always true due to limited range of data type");
}
}
location = input_location;
else
location = gimple_location (stmt);
- warning (OPT_Wstrict_overflow,
- ("%Hassuming signed overflow does not occur when "
- "simplifying / or %% to >> or &"),
- &location);
+ warning_at (location, OPT_Wstrict_overflow,
+ "assuming signed overflow does not occur when "
+ "simplifying %</%> or %<%%%> to %<>>%> or %<&%>");
}
}
location = input_location;
else
location = gimple_location (stmt);
- warning (OPT_Wstrict_overflow,
- ("%Hassuming signed overflow does not occur when "
- "simplifying abs (X) to X or -X"),
- &location);
+ warning_at (location, OPT_Wstrict_overflow,
+ "assuming signed overflow does not occur when "
+ "simplifying %<abs (X)%> to %<X%> or %<-X%>");
}
gimple_assign_set_rhs1 (stmt, op);
}
else
{
- error ("%HCorrupted value profile: %s profiler overall count (%d) "
- "does not match BB count (%d)", &locus, name, (int)*all,
- (int)bb_count);
+ error_at (locus, "Corrupted value profile: %s "
+ "profiler overall count (%d) does not match BB count (%d)",
+ name, (int)*all, (int)bb_count);
return true;
}
}