diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2022-06-12 16:44:07 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@kataplop.net> | 2022-06-14 22:52:36 +0200 |
commit | 29f57496698d2098d48b9fff7807f22dadc10e6b (patch) | |
tree | 9edd9b876f1f7e4418281c7d14dfceac44418d70 /gcc/rust/lex/rust-lex.cc | |
parent | 44f2de02d478b5d3defa5f091ee6504fa5d2e2e6 (diff) | |
download | gcc-29f57496698d2098d48b9fff7807f22dadc10e6b.zip gcc-29f57496698d2098d48b9fff7807f22dadc10e6b.tar.gz gcc-29f57496698d2098d48b9fff7807f22dadc10e6b.tar.bz2 |
Fix formatting error on 32-bits targets
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 <dkm@kataplop.net>
Co-authored-by: Rainer Orth <ro@gcc.gnu.org>
Diffstat (limited to 'gcc/rust/lex/rust-lex.cc')
-rw-r--r-- | gcc/rust/lex/rust-lex.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |