From c14fad231870eebbd1102c1eb86124a53a3e8ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Sat, 19 Jun 2021 21:56:08 +0200 Subject: Fix various Wformat-diag diagnostics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix warnings mainly coming from ` being used instead of %< and %>. Also fixing occurences of : ../../gcc/rust/lex/rust-token.cc:126:40: warning: unquoted sequence of 2 consecutive punctuation characters ‘',’ in format [-Wformat-diag] 126 | "attempted to get string for '%s', which has no string. " | ^~ ../../gcc/rust/lex/rust-token.cc:127:39: warning: spurious trailing punctuation sequence ‘.’ in format [-Wformat-diag] 127 | "returning empty string instead.", | ^ ../../gcc/rust/lex/rust-token.cc:126:37: warning: unterminated quote character ‘'’ in format [-Wformat-diag] 126 | "attempted to get string for '%s', which has no string. " | ^ and various occurences of : ../../gcc/rust/lex/rust-lex.cc:1326:11: warning: unquoted keyword ‘char’ in format [-Wformat-diag] 1326 | "byte char %<%c%> out of range", byte_char); | ^~~~ Also using full word for arguments, integer, character, declaration, variable, floting-point instead of args, int, char, decl, var, float when applicable. --- gcc/rust/backend/rust-compile-expr.h | 2 +- gcc/rust/backend/rust-compile-resolve-path.cc | 4 ++-- gcc/rust/backend/rust-compile-stmt.h | 5 +++-- gcc/rust/backend/rust-compile.cc | 6 ++++-- 4 files changed, 10 insertions(+), 7 deletions(-) (limited to 'gcc/rust/backend') diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h index 09652f1..5a224e2 100644 --- a/gcc/rust/backend/rust-compile-expr.h +++ b/gcc/rust/backend/rust-compile-expr.h @@ -203,7 +203,7 @@ public: != 0) { rust_fatal_error (expr.get_locus (), - "bad float number in literal"); + "bad floating-point number in literal"); return; } diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc index cb1cfcf..af8d609 100644 --- a/gcc/rust/backend/rust-compile-resolve-path.cc +++ b/gcc/rust/backend/rust-compile-resolve-path.cc @@ -117,7 +117,7 @@ ResolvePathRef::visit (HIR::PathInExpression &expr) else { rust_error_at (expr.get_locus (), - "failed to lookup definition decl"); + "failed to lookup definition declaration"); return; } } @@ -125,7 +125,7 @@ ResolvePathRef::visit (HIR::PathInExpression &expr) if (!ctx->lookup_function_decl (lookup->get_ty_ref (), &fn)) { rust_fatal_error (expr.get_locus (), - "forward decl was not compiled 1"); + "forward declaration was not compiled"); return; } } diff --git a/gcc/rust/backend/rust-compile-stmt.h b/gcc/rust/backend/rust-compile-stmt.h index a777df6..5f37e07 100644 --- a/gcc/rust/backend/rust-compile-stmt.h +++ b/gcc/rust/backend/rust-compile-stmt.h @@ -64,7 +64,8 @@ public: if (!ctx->get_tyctx ()->lookup_type (stmt.get_mappings ().get_hirid (), &ty)) { - rust_fatal_error (stmt.get_locus (), "failed to lookup var decl type"); + rust_fatal_error (stmt.get_locus (), + "failed to lookup variable declaration type"); return; } @@ -72,7 +73,7 @@ public: if (!ctx->lookup_var_decl (stmt.get_mappings ().get_hirid (), &var)) { rust_fatal_error (stmt.get_locus (), - "failed to lookup compiled variable decl"); + "failed to lookup compiled variable declaration"); return; } diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index 77036b2..351271c 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -141,7 +141,8 @@ CompileExpr::visit (HIR::MethodCallExpr &expr) expr.get_mappings ().get_crate_num (), ref, nullptr); if (resolved_item == nullptr) { - rust_error_at (expr.get_locus (), "failed to lookup forward decl"); + rust_error_at (expr.get_locus (), + "failed to lookup forward declaration"); return; } @@ -162,7 +163,8 @@ CompileExpr::visit (HIR::MethodCallExpr &expr) if (!ctx->lookup_function_decl (fntype->get_ty_ref (), &fn)) { - rust_error_at (expr.get_locus (), "forward decl was not compiled"); + rust_error_at (expr.get_locus (), + "forward declaration was not compiled"); return; } } -- cgit v1.1