No functional change intended.
gcc/analyzer/ChangeLog:
PR c/104896
* sm-malloc.cc: Replace "%<%s%>" with "%qs" in message wording.
gcc/c-family/ChangeLog:
PR c/104896
* c-lex.cc (c_common_lex_availability_macro): Replace "%<%s%>"
with "%qs" in message wording.
* c-opts.cc (c_common_handle_option): Likewise.
* c-warn.cc (warn_parm_array_mismatch): Likewise.
gcc/ChangeLog:
PR c/104896
* common/config/ia64/ia64-common.cc (ia64_handle_option): Replace
"%<%s%>" with "%qs" in message wording.
* common/config/rs6000/rs6000-common.cc (rs6000_handle_option):
Likewise.
* config/aarch64/aarch64.cc (aarch64_validate_sls_mitigation):
Likewise.
(aarch64_override_options): Likewise.
(aarch64_process_target_attr): Likewise.
* config/arm/aarch-common.cc (aarch_validate_mbranch_protection):
Likewise.
* config/pru/pru.cc (pru_insert_attributes): Likewise.
* config/riscv/riscv-target-attr.cc
(riscv_target_attr_parser::parse_arch): Likewise.
* omp-general.cc (oacc_verify_routine_clauses): Likewise.
* tree-ssa-uninit.cc (maybe_warn_read_write_only): Likewise.
(maybe_warn_pass_by_reference): Likewise.
gcc/cp/ChangeLog:
PR c/104896
* cvt.cc (maybe_warn_nodiscard): Replace "%<%s%>" with "%qs" in
message wording.
gcc/fortran/ChangeLog:
PR c/104896
* resolve.cc (resolve_operator): Replace "%<%s%>" with "%qs" in
message wording.
gcc/go/ChangeLog:
PR c/104896
* gofrontend/embed.cc (Gogo::initializer_for_embeds): Replace
"%<%s%>" with "%qs" in message wording.
* gofrontend/expressions.cc
(Selector_expression::lower_method_expression): Likewise.
* gofrontend/gogo.cc (Gogo::set_package_name): Likewise.
(Named_object::export_named_object): Likewise.
* gofrontend/parse.cc (Parse::struct_type): Likewise.
(Parse::parameter_list): Likewise.
gcc/rust/ChangeLog:
PR c/104896
* backend/rust-compile-expr.cc
(CompileExpr::compile_integer_literal): Replace "%<%s%>" with
"%qs" in message wording.
(CompileExpr::compile_float_literal): Likewise.
* backend/rust-compile-intrinsic.cc (Intrinsics::compile):
Likewise.
* backend/rust-tree.cc (maybe_warn_nodiscard): Likewise.
* checks/lints/rust-lint-scan-deadcode.h: Likewise.
* lex/rust-lex.cc (Lexer::parse_partial_unicode_escape): Likewise.
(Lexer::parse_raw_byte_string): Likewise.
* lex/rust-token.cc (Token::get_str): Likewise.
* metadata/rust-export-metadata.cc
(PublicInterface::write_to_path): Likewise.
* parse/rust-parse.cc
(peculiar_fragment_match_compatible_fragment): Likewise.
(peculiar_fragment_match_compatible): Likewise.
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
Likewise.
* resolve/rust-ast-resolve-toplevel.h: Likewise.
* resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go):
Likewise.
* rust-session-manager.cc (validate_crate_name): Likewise.
(Session::load_extern_crate): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Likewise.
(TypeCheckExpr::resolve_fn_trait_call): Likewise.
* typecheck/rust-hir-type-check-implitem.cc
(TypeCheckImplItemWithTrait::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc
(TypeCheckItem::validate_trait_impl_block): Likewise.
* typecheck/rust-hir-type-check-struct.cc
(TypeCheckStructExpr::visit): Likewise.
* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
Likewise.
* typecheck/rust-tyty.cc (BaseType::bounds_compatible): Likewise.
* typecheck/rust-unify.cc (UnifyRules::emit_abi_mismatch):
Likewise.
* util/rust-attributes.cc (AttributeChecker::visit): Likewise.
libcpp/ChangeLog:
PR c/104896
* pch.cc (cpp_valid_state): Replace "%<%s%>" with "%qs" in message
wording.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
{
/* CWE-416: Use After Free. */
ctxt.add_cwe (416);
- return ctxt.warn ("use after %<%s%> of %qE",
+ return ctxt.warn ("use after %qs of %qE",
m_deallocator->m_name, m_arg);
}
gcc_unreachable ();
case WORDING_FREED:
pp_printf (&pp,
- "use after %<%s%> of %qE; freed at %@",
+ "use after %qs of %qE; freed at %@",
funcname, ev.m_expr, &m_free_event);
return true;
case WORDING_DELETED:
pp_printf (&pp,
- "use after %<%s%> of %qE; deleted at %@",
+ "use after %qs of %qE; deleted at %@",
funcname, ev.m_expr, &m_free_event);
return true;
case WORDING_DEALLOCATED:
pp_printf (&pp,
- "use after %<%s%> of %qE;"
+ "use after %qs of %qE;"
" deallocated at %@",
funcname, ev.m_expr, &m_free_event);
return true;
else
{
pp_printf (&pp,
- "use after %<%s%> of %qE",
+ "use after %qs of %qE",
funcname, ev.m_expr);
return true;
}
case MEMSPACE_CODE:
case MEMSPACE_GLOBALS:
case MEMSPACE_READONLY_DATA:
- return ctxt.warn ("%<%s%> of %qE which points to memory"
+ return ctxt.warn ("%qs of %qE which points to memory"
" not on the heap",
m_funcname, m_arg);
break;
case MEMSPACE_STACK:
- return ctxt.warn ("%<%s%> of %qE which points to memory"
+ return ctxt.warn ("%qs of %qE which points to memory"
" on the stack",
m_funcname, m_arg);
break;
if (token->type != CPP_CLOSE_PAREN)
{
cpp_error (pfile, CPP_DL_ERROR,
- "expected %<)%> after %<%s%>", name);
+ "expected %<)%> after %qs", name);
name = "";
}
}
if (!strcmp (arg, "p1689r5"))
cpp_opts->deps.fdeps_format = FDEPS_FMT_P1689R5;
else
- error ("%<-fdeps-format=%> unknown format %<%s%>", arg);
+ error ("%<-fdeps-format=%> unknown format %qs", arg);
break;
case OPT_fdeps_file_:
else
warned = warning_at (&richloc, OPT_Wvla_parameter,
"argument %u of type %s declared "
- "with mismatched bound %<%s%>",
+ "with mismatched bound %qs",
parmpos + 1, newparmstr.c_str (),
newbndstr);
}
else
inform (&richloc, "previously declared as %s with bound "
- "%<%s%>", curparmstr.c_str (), curbndstr);
+ "%qs", curparmstr.c_str (), curbndstr);
continue;
}
if (warning_at (newloc, OPT_Wvla_parameter,
"argument %u of type %s declared with "
- "mismatched bound %<%s%>",
+ "mismatched bound %qs",
parmpos + 1, newparmstr.c_str (), newbndstr))
inform (origloc, "previously declared as %s with bound %qs",
curparmstr.c_str (), curbndstr);
{
case OPT_mtls_size_:
if (value != 14 && value != 22 && value != 64)
- error_at (loc, "bad value %<%s%> for %<-mtls-size=%> switch", arg);
+ error_at (loc, "bad value %qs for %<-mtls-size=%> switch", arg);
return true;
default:
case OPT_mabi_ieeelongdouble:
if (opts->x_rs6000_long_double_type_size == 64)
{
- error_at (loc, "option %<%s%> requires %<-mlong-double-128%>",
+ error_at (loc, "option %qs requires %<-mlong-double-128%>",
decoded->orig_option_with_args_text);
return true;
}
}
else
{
- error ("invalid argument %<%s%> for %<-mharden-sls=%>", str);
+ error ("invalid argument %qs for %<-mharden-sls=%>", str);
break;
}
str = strtok_r (NULL, ",", &token_save);
= aarch64_get_extension_string_for_isa_flags (full_arch_flags,
full_cpu_flags);
warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch "
- "and resulted in options %<%s%> being added",
+ "and resulted in options %qs being added",
aarch64_cpu_string,
aarch64_arch_string,
ext_diff.c_str ());
= aarch64_parse_extension (with_plus.c_str (), &isa_temp, nullptr);
if (ext_res == AARCH_PARSE_OK)
- error ("arch extension %<%s%> should be prefixed by %<+%>",
+ error ("arch extension %qs should be prefixed by %<+%>",
token);
else
error ("pragma or attribute %<target(\"%s\")%> is not valid", token);
{
res = false;
if (strcmp (str, "") == 0)
- error ("missing feature or flag for %<%s%>", opt);
+ error ("missing feature or flag for %qs", opt);
else
- error ("invalid argument %<%s%> for %<%s%>", str, opt);
+ error ("invalid argument %qs for %qs", str, opt);
break;
}
if (reject_alone && alone_str != NULL)
{
res = false;
- error ("argument %<%s%> can only appear alone in %<%s%>",
+ error ("argument %qs can only appear alone in %qs",
alone_str, opt);
break;
}
error ("only 32-bit access is supported "
"for %<__regio_symbol%> address space");
if (strcmp (name, "__R30") != 0 && strcmp (name, "__R31") != 0)
- error ("register name %<%s%> not recognized "
+ error ("register name %qs not recognized "
"in %<__regio_symbol%> address space", name);
}
error_at (
m_loc,
"unexpected arch for %<target()%> attribute: bad "
- "string found %<%s%>", token);
+ "string found %qs", token);
goto fail;
}
const char *format
= (msg
? G_("ignoring return value of %qD, "
- "declared with attribute %<nodiscard%>: %<%s%>")
+ "declared with attribute %<nodiscard%>: %qs")
: G_("ignoring return value of %qD, "
"declared with attribute %<nodiscard%>%s"));
const char *raw_msg = msg ? (const char *) msg : "";
const char *format
= (msg
? G_("ignoring returned value of type %qT, "
- "declared with attribute %<nodiscard%>: %<%s%>")
+ "declared with attribute %<nodiscard%>: %qs")
: G_("ignoring returned value of type %qT, "
"declared with attribute %<nodiscard%>%s"));
const char *raw_msg = msg ? (const char *) msg : "";
}
CHECK_INTERFACES
- gfc_error ("Operand of unary numeric operator %<%s%> at %L is %s",
+ gfc_error ("Operand of unary numeric operator %qs at %L is %s",
gfc_op2string (e->value.op.op), &e->where, gfc_typename (e));
return false;
if (flag_unsigned && gfc_invalid_unsigned_ops (op1, op2))
{
CHECK_INTERFACES
- gfc_error ("Operands of binary numeric operator %<%s%> at %L are "
+ gfc_error ("Operands of binary numeric operator %qs at %L are "
"%s/%s", gfc_op2string (e->value.op.op), &e->where,
gfc_typename (op1), gfc_typename (op2));
return false;
{
CHECK_INTERFACES
gfc_error ("Unexpected derived-type entities in binary intrinsic "
- "numeric operator %<%s%> at %L",
+ "numeric operator %qs at %L",
gfc_op2string (e->value.op.op), &e->where);
return false;
}
else
{
CHECK_INTERFACES
- gfc_error ("Operands of binary numeric operator %<%s%> at %L are %s/%s",
+ gfc_error ("Operands of binary numeric operator %qs at %L are %s/%s",
gfc_op2string (e->value.op.op), &e->where, gfc_typename (op1),
gfc_typename (op2));
return false;
}
CHECK_INTERFACES
- gfc_error ("Operands of logical operator %<%s%> at %L are %s/%s",
+ gfc_error ("Operands of logical operator %qs at %L are %s/%s",
gfc_op2string (e->value.op.op), &e->where, gfc_typename (op1),
gfc_typename (op2));
return false;
else
{
CHECK_INTERFACES
- gfc_error ("Operands of comparison operator %<%s%> at %L are %s/%s",
+ gfc_error ("Operands of comparison operator %qs at %L are %s/%s",
gfc_op2string (e->value.op.op), &e->where, gfc_typename (op1),
gfc_typename (op2));
}
guessed = lookup_uop_fuzzy (name, e->value.op.uop->ns->uop_root);
CHECK_INTERFACES
if (guessed)
- gfc_error ("Unknown operator %<%s%> at %L; did you mean "
- "%<%s%>?", name, &e->where, guessed);
+ gfc_error ("Unknown operator %qs at %L; did you mean "
+ "%qs?", name, &e->where, guessed);
else
- gfc_error ("Unknown operator %<%s%> at %L", name, &e->where);
+ gfc_error ("Unknown operator %qs at %L", name, &e->where);
}
else if (op2 == NULL)
{
CHECK_INTERFACES
- gfc_error ("Operand of user operator %<%s%> at %L is %s",
+ gfc_error ("Operand of user operator %qs at %L is %s",
e->value.op.uop->name, &e->where, gfc_typename (op1));
}
else
{
e->value.op.uop->op->sym->attr.referenced = 1;
CHECK_INTERFACES
- gfc_error ("Operands of user operator %<%s%> at %L are %s/%s",
+ gfc_error ("Operands of user operator %qs at %L are %s/%s",
e->value.op.uop->name, &e->where, gfc_typename (op1),
gfc_typename (op2));
}
{
go_error_at(loc,
("invalid go:embed: build system did not "
- "map pattern %<%s%>"),
+ "map pattern %qs"),
pe->c_str());
continue;
}
{
go_error_at(loc,
("invalid go:embed: build system did not "
- "map file %<%s%>"),
+ "map file %qs"),
pf->c_str());
continue;
}
if (nt != NULL)
{
if (!is_ambiguous)
- go_error_at(location, "type %<%s%s%> has no method %<%s%>",
+ go_error_at(location, "type %<%s%s%> has no method %qs",
is_pointer ? "*" : "",
nt->message_name().c_str(),
Gogo::message_name(name).c_str());
else
- go_error_at(location, "method %<%s%s%> is ambiguous in type %<%s%>",
+ go_error_at(location, "method %<%s%s%> is ambiguous in type %qs",
Gogo::message_name(name).c_str(),
is_pointer ? "*" : "",
nt->message_name().c_str());
else
{
if (!is_ambiguous)
- go_error_at(location, "type has no method %<%s%>",
+ go_error_at(location, "type has no method %qs",
Gogo::message_name(name).c_str());
else
- go_error_at(location, "method %<%s%> is ambiguous",
+ go_error_at(location, "method %qs is ambiguous",
Gogo::message_name(name).c_str());
}
return Expression::make_error(location);
if (this->package_ != NULL)
{
if (this->package_->package_name() != package_name)
- go_error_at(location, "expected package %<%s%>",
+ go_error_at(location, "expected package %qs",
Gogo::message_name(this->package_->package_name()).c_str());
return;
}
case NAMED_OBJECT_TYPE_DECLARATION:
go_error_at(this->type_declaration_value()->location(),
- "attempt to export %<%s%> which was declared but not defined",
+ "attempt to export %qs which was declared but not defined",
this->message_name().c_str());
break;
{
if (pi->field_name() == pj->field_name()
&& !Gogo::is_sink_name(pi->field_name()))
- go_error_at(pi->location(), "duplicate field name %<%s%>",
+ go_error_at(pi->location(), "duplicate field name %qs",
Gogo::message_name(pi->field_name()).c_str());
}
}
type = Type::make_forward_declaration(no);
else
{
- go_error_at(p->location(), "expected %<%s%> to be a type",
+ go_error_at(p->location(), "expected %qs to be a type",
Gogo::message_name(p->name()).c_str());
saw_error = true;
type = Type::make_error_type();
/* See <https://gcc.gnu.org/PR93465>; the semantics of combining
OpenACC and OpenMP 'target' are not clear. */
error_at (loc,
- "cannot apply %<%s%> to %qD, which has also been"
+ "cannot apply %qs to %qD, which has also been"
" marked with an OpenMP 'declare target' directive",
routine_str, fndecl);
/* Incompatible. */
if (c_diag != NULL_TREE)
error_at (OMP_CLAUSE_LOCATION (c_diag),
"incompatible %qs clause when applying"
- " %<%s%> to %qD, which has already been"
+ " %qs to %qD, which has already been"
" marked with an OpenACC 'routine' directive",
omp_clause_code_name[OMP_CLAUSE_CODE (c_diag)],
routine_str, fndecl);
else if (c_diag_p != NULL_TREE)
error_at (loc,
"missing %qs clause when applying"
- " %<%s%> to %qD, which has already been"
+ " %qs to %qD, which has already been"
" marked with an OpenACC 'routine' directive",
omp_clause_code_name[OMP_CLAUSE_CODE (c_diag_p)],
routine_str, fndecl);
if (mpz_cmp (ival, type_min) < 0 || mpz_cmp (ival, type_max) > 0)
{
rust_error_at (expr.get_locus (),
- "integer overflows the respective type %<%s%>",
+ "integer overflows the respective type %qs",
tyty->get_name ().c_str ());
return error_mark_node;
}
if (TREE_OVERFLOW (real_value) || real_value_overflow)
{
rust_error_at (expr.get_locus (),
- "decimal overflows the respective type %<%s%>",
+ "decimal overflows the respective type %qs",
tyty->get_name ().c_str ());
return error_mark_node;
}
location_t locus = ctx->get_mappings ()->lookup_location (fntype->get_ref ());
rust_error_at (locus, ErrorCode::E0093,
- "unrecognized intrinsic function: %<%s%>",
+ "unrecognized intrinsic function: %qs",
fntype->get_identifier ().c_str ());
return error_mark_node;
if (args)
msg.escape (TREE_STRING_POINTER (TREE_VALUE (args)));
const char *format
- = (msg ? G_ ("ignoring return value of %qD, that must be used: %<%s%>")
+ = (msg ? G_ ("ignoring return value of %qD, that must be used: %qs")
: G_ ("ignoring return value of %qD, that must be used"));
const char *raw_msg = msg ? (const char *) msg : "";
auto_diagnostic_group d;
msg.escape (TREE_STRING_POINTER (TREE_VALUE (args)));
const char *format
= (msg ? G_ (
- "ignoring returned value of type %qT, that must be used: %<%s%>")
+ "ignoring returned value of type %qT, that must be used: %qs")
: G_ ("ignoring returned value of type %qT, that must be used"));
const char *raw_msg = msg ? (const char *) msg : "";
auto_diagnostic_group d;
{
rust_warning_at (
function.get_function_name ().get_locus (), 0,
- "associated function is never used: %<%s%>",
+ "associated function is never used: %qs",
function.get_function_name ().as_string ().c_str ());
}
}
{
rust_warning_at (
function.get_function_name ().get_locus (), 0,
- "function is never used: %<%s%>",
+ "function is never used: %qs",
function.get_function_name ().as_string ().c_str ());
}
}
= stct.get_identifier ().as_string ().at (0) == '_';
if (!name_starts_underscore)
rust_warning_at (stct.get_locus (), 0,
- "struct is never constructed: %<%s%>",
+ "struct is never constructed: %qs",
stct.get_identifier ().as_string ().c_str ());
}
else
&& !field.get_visibility ().is_public ())
{
rust_warning_at (field.get_locus (), 0,
- "field is never read: %<%s%>",
+ "field is never read: %qs",
field.get_field_name ().as_string ().c_str ());
}
}
if (should_warn (hirId) && !stct.get_visibility ().is_public ())
{
rust_warning_at (stct.get_locus (), 0,
- "struct is never constructed: %<%s%>",
+ "struct is never constructed: %qs",
stct.get_identifier ().as_string ().c_str ());
}
}
else
{
rust_error_at (get_current_location (),
- "invalid character %<%s%> in unicode escape",
+ "invalid character %qs in unicode escape",
current_char.as_string ().c_str ());
// TODO use utf-8 codepoint to skip whitespaces
while (current_char != '}' && current_char != '{'
else if (current_char.value > 127)
{
rust_error_at (get_current_location (),
- "character %<%s%> in raw byte string out of range",
+ "character %qs in raw byte string out of range",
current_char.as_string ().c_str ());
current_char = 0;
}
if (str == NULL)
{
rust_error_at (get_locus (),
- "attempted to get string for %<%s%>, which has no string. "
+ "attempted to get string for %qs, which has no string. "
"returning empty string instead",
get_token_description ());
return empty;
{
rust_error_at (UNDEF_LOCATION,
"expected metadata-output path to have base file name of: "
- "%<%s%> got %<%s%>",
+ "%qs got %qs",
expected_file_name.c_str (), path_base_name);
return;
}
if (nfd == NULL)
{
rust_error_at (UNDEF_LOCATION,
- "failed to open file %<%s%> for writing: %s",
+ "failed to open file %qs for writing: %s",
path.c_str (), xstrerror (errno));
return;
}
// write data
if (fwrite (kMagicHeader, sizeof (kMagicHeader), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (fwrite (checksum, sizeof (checksum), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (fwrite (kSzDelim, sizeof (kSzDelim), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (fwrite (current_crate_name.c_str (), current_crate_name.size (), 1, nfd)
< 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (fwrite (kSzDelim, sizeof (kSzDelim), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (fwrite (size_buffer.c_str (), size_buffer.size (), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (fwrite (kSzDelim, sizeof (kSzDelim), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (!buf.empty ())
if (fwrite (buf.c_str (), buf.size (), 1, nfd) < 1)
{
- rust_error_at (UNDEF_LOCATION, "failed to write to file %<%s%>: %s",
+ rust_error_at (UNDEF_LOCATION, "failed to write to file %qs: %s",
path.c_str (), xstrerror (errno));
fclose (nfd);
return;
if (!is_valid)
rust_error_at (
match_locus,
- "fragment specifier %<%s%> is not allowed after %<%s%> fragments",
+ "fragment specifier %qs is not allowed after %qs fragments",
spec.as_string ().c_str (), last_spec.as_string ().c_str ());
return is_valid;
break;
}
- rust_error_at (error_locus, "%s is not allowed after %<%s%> fragment",
+ rust_error_at (error_locus, "%s is not allowed after %qs fragment",
kind_str.c_str (),
last_match.get_frag_spec ().as_string ().c_str ());
auto allowed_toks_str
if (in_middle_of_path && segment.is_lower_self_seg ())
{
rust_error_at (segment.get_locus (), ErrorCode::E0433,
- "failed to resolve: %<%s%> in paths can only be used "
+ "failed to resolve: %qs in paths can only be used "
"in start position",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
else
{
rust_error_at (segment.get_locus (),
- "Cannot find path %<%s%> in this scope",
+ "Cannot find path %qs in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
else if (is_first_segment)
{
rust_error_at (segment.get_locus (), ErrorCode::E0433,
- "Cannot find path %<%s%> in this scope",
+ "Cannot find path %qs in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
else
{
rust_error_at (segment.get_locus (),
- "Cannot find path %<%s%> in this scope",
+ "Cannot find path %qs in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
if (resolved_node_id == UNKNOWN_NODEID)
{
rust_error_at (segment.get_locus (),
- "cannot find simple path segment %<%s%> in this scope",
+ "cannot find simple path segment %qs in this scope",
segment.as_string ().c_str ());
return UNKNOWN_NODEID;
}
found_crate_num);
if (!found)
{
- rust_error_at (extern_crate.get_locus (), "unknown crate %<%s%>",
+ rust_error_at (extern_crate.get_locus (), "unknown crate %qs",
extern_crate.get_referenced_crate ().c_str ());
return;
}
if (in_middle_of_path && segment->is_lower_self_seg ())
{
rust_error_at (segment->get_locus (), ErrorCode::E0433,
- "failed to resolve: %<%s%> in paths can only be used "
+ "failed to resolve: %qs in paths can only be used "
"in start position",
segment->as_string ().c_str ());
return false;
else
{
rust_error_at (segment->get_locus (),
- "Cannot find path %<%s%> in this scope",
+ "Cannot find path %qs in this scope",
segment->as_string ().c_str ());
return false;
}
if (!(is_alphabetic (c.value) || is_numeric (c.value) || c.value == '_'))
{
error = Error (UNDEF_LOCATION,
- "invalid character %<%s%> in crate name: %<%s%>",
+ "invalid character %qs in crate name: %qs",
c.as_string ().c_str (), crate_name.c_str ());
return false;
}
if (stream == NULL // No stream and
&& proc_macros.empty ()) // no proc macros
{
- rust_error_at (locus, "failed to locate crate %<%s%>",
+ rust_error_at (locus, "failed to locate crate %qs",
import_name.c_str ());
return UNKNOWN_NODEID;
}
const std::string current_crate_name = mappings->get_current_crate_name ();
if (current_crate_name.compare (extern_crate.get_crate_name ()) == 0)
{
- rust_error_at (locus, "current crate name %<%s%> collides with this",
+ rust_error_at (locus, "current crate name %qs collides with this",
current_crate_name.c_str ());
return UNKNOWN_NODEID;
}
r.add_range (expr.get_array_expr ()->get_locus ());
r.add_range (expr.get_index_expr ()->get_locus ());
rust_error_at (r, ErrorCode::E0277,
- "the type %<%s%> cannot be indexed by %<%s%>",
+ "the type %qs cannot be indexed by %qs",
array_expr_ty->get_name ().c_str (),
index_expr_ty->get_name ().c_str ());
}
// FIXME
// we need to have a unified way or error'ing when we are missing lang
// items that is useful
- rust_fatal_error (expr.get_locus (), "unable to find lang item: %<%s%>",
+ rust_fatal_error (expr.get_locus (), "unable to find lang item: %qs",
LangItem::ToString (lang_item_type).c_str ());
}
rust_assert (lang_item_defined);
r.add_range (c.candidate.locus);
rust_error_at (
- r, "multiple candidates found for function trait method call %<%s%>",
+ r, "multiple candidates found for function trait method call %qs",
method_name.as_string ().c_str ());
return false;
}
r.add_range (resolved_trait_item.get_locus ());
rust_error_at (
- r, "constant %<%s%> has an incompatible type for trait %<%s%>",
+ r, "constant %qs has an incompatible type for trait %qs",
constant.get_identifier ().as_string ().c_str (),
trait_reference.get_name ().c_str ());
}
{
rich_location r (line_table, type.get_locus ());
r.add_range (trait_reference.get_locus ());
- rust_error_at (r, "type alias %<%s%> is not a member of trait %<%s%>",
+ rust_error_at (r, "type alias %qs is not a member of trait %qs",
type.get_new_type_name ().as_string ().c_str (),
trait_reference.get_name ().c_str ());
return;
r.add_range (resolved_trait_item.get_locus ());
rust_error_at (
- r, "type alias %<%s%> has an incompatible type for trait %<%s%>",
+ r, "type alias %qs has an incompatible type for trait %qs",
type.get_new_type_name ().as_string ().c_str (),
trait_reference.get_name ().c_str ());
}
{
rich_location r (line_table, function.get_locus ());
r.add_range (trait_reference.get_locus ());
- rust_error_at (r, "method %<%s%> is not a member of trait %<%s%>",
+ rust_error_at (r, "method %qs is not a member of trait %qs",
function.get_function_name ().as_string ().c_str (),
trait_reference.get_name ().c_str ());
return;
r.add_range (resolved_trait_item.get_locus ());
rust_error_at (r, ErrorCode::E0053,
- "method %<%s%> has an incompatible type for trait %<%s%>",
+ "method %qs has an incompatible type for trait %qs",
function.get_function_name ().as_string ().c_str (),
trait_reference.get_name ().c_str ());
}
}
rust_error_at (r, ErrorCode::E0046,
- "missing %s in implementation of trait %<%s%>",
+ "missing %s in implementation of trait %qs",
missing_items_buf.c_str (),
trait_reference->get_name ().c_str ());
}
repeat_location.add_range (prev_field_locus);
rust_error_at (repeat_location, ErrorCode::E0062,
- "field %<%s%> specified more than once",
+ "field %qs specified more than once",
field.field_name.as_string ().c_str ());
return false;
}
repeat_location.add_range (prev_field_locus);
rust_error_at (repeat_location, ErrorCode::E0062,
- "field %<%s%> specified more than once",
+ "field %qs specified more than once",
field_name.c_str ());
return false;
}
repeat_location.add_range (prev_field_locus);
rust_error_at (repeat_location, ErrorCode::E0062,
- "field %<%s%> specified more than once",
+ "field %qs specified more than once",
field.get_field_name ().as_string ().c_str ());
return false;
}
{
rust_error_at (
call.get_locus (), ErrorCode::E0423,
- "expected function, tuple struct or tuple variant, found struct %<%s%>",
+ "expected function, tuple struct or tuple variant, found struct %qs",
type.get_name ().c_str ());
return;
}
if (emit_error)
{
rust_error_at (r, ErrorCode::E0277,
- "bounds not satisfied for %s %<%s%> is not satisfied",
+ "bounds not satisfied for %s %qs is not satisfied",
other.get_name ().c_str (), missing_preds.c_str ());
// rust_assert (!emit_error);
}
rich_location r (line_table, locus);
r.add_range (lhs.get_locus ());
r.add_range (rhs.get_locus ());
- rust_error_at (r, "mistached abi %<%s%> got %<%s%>",
+ rust_error_at (r, "mistached abi %qs got %qs",
get_string_from_abi (expected.get_abi ()).c_str (),
get_string_from_abi (got.get_abi ()).c_str ());
}
if (!attribute.has_attr_input ())
{
rust_error_at (attribute.get_locus (),
- "malformed %<%s%> attribute input", name);
+ "malformed %qs attribute input", name);
rust_inform (
attribute.get_locus (),
"must be of the form: %<#[proc_macro_derive(TraitName, "
location_t parmloc = DECL_SOURCE_LOCATION (parm);
inform (parmloc, "accessing argument %u of a function declared with "
- "attribute %<%s%>",
+ "attribute %qs",
argno + 1, access_str);
break;
{
location_t loc = DECL_SOURCE_LOCATION (fndecl);
inform (loc, "in a call to %qD declared with "
- "attribute %<%s%> here", fndecl, access_str);
+ "attribute %qs here", fndecl, access_str);
}
else
{
/* Handle calls through function pointers. */
location_t loc = gimple_location (stmt);
inform (loc, "in a call to %qT declared with "
- "attribute %<%s%>", fntype, access_str);
+ "attribute %qs", fntype, access_str);
}
}
else
if (CPP_OPTION (r, warn_invalid_pch))
cpp_warning_syshdr (r, CPP_W_INVALID_PCH,
"%s: not used because %<%.*s%> defined as "
- "%<%s%> not %<%.*s%>",
+ "%qs not %<%.*s%>",
name, m.name_length, namebuf,
newdefn + m.name_length,
m.definition_length - m.name_length,