[Bug rust/105913] New: gccrs doesn't compile on 32-bit targets

ro at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 10 11:22:28 GMT 2022


            Bug ID: 105913
           Summary: gccrs doesn't compile on 32-bit targets
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rust
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
            Target: i386-pc-solaris2.11, i686-pc-linux-gnu

Created attachment 53115
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53115&action=edit
hacky patch

I recently tried bootstrapping the devel/rust/master branch as of
on Solaris/x86 and Linux/i686, but unlike Linux/x86_64 the build failed for
several instances of the same issue:

/vol/gcc/src/git/rust/gcc/rust/lex/rust-lex.cc: In member function
'std::pair<Rust::Codepoint, int> Rust::Lexer::parse_partial_unicode_escape()':
/vol/gcc/src/git/rust/gcc/rust/lex/rust-lex.cc:1574:43: error: format '%lu'
expects argument of type 'long unsigned int', but argument 3 has type
'std::__cxx11::basic_string<char>::size_type' {aka 'unsigned int'}
 1574 |                      "characters; it is %lu",
      |                                         ~~^
      |                                           |
      |                                           long unsigned int
      |                                         %u
 1575 |                      num_str.length ());
      |                      ~~~~~~~~~~~~~~~~~
      |                                     |
std::__cxx11::basic_string<char>::size_type {aka unsigned int}

It's always trying to print size_t (unsigned int) with a %ld or %lu format.

The attached hacky patch casts the arguments accordingly, and allows the
to finish and the testsuite (both 32 and 64-bit) to run successfully.

More information about the Gcc-bugs mailing list