From 29f57496698d2098d48b9fff7807f22dadc10e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Sun, 12 Jun 2022 16:44:07 +0200 Subject: Fix formatting error on 32-bits targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Printing size_t as [unsigned] long (%ld or %lu) raises warnings on 32-bits targets. As the GCC pretty printer doesn't have the equivalent of libc's %z/%zu, fix all formats to use unsigned long and cast values. refs #1229 Signed-off-by: Marc Poulhiès Co-authored-by: Rainer Orth --- gcc/rust/lex/rust-lex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/rust/lex/rust-lex.cc') diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc index 9e0595b..13921e7 100644 --- a/gcc/rust/lex/rust-lex.cc +++ b/gcc/rust/lex/rust-lex.cc @@ -1573,7 +1573,7 @@ Lexer::parse_partial_unicode_escape () rust_error_at (get_current_location (), "unicode escape should be between 1 and 6 hex " "characters; it is %lu", - num_str.length ()); + (unsigned long) num_str.length ()); // return false; return std::make_pair (Codepoint (0), additional_length_offset); } -- cgit v1.1