https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105913

            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
9d81164aa0447c738fe0435de14ec9666a03d5da
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'}
[-Werror=format=]
 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
bootstrap
to finish and the testsuite (both 32 and 64-bit) to run successfully.

Reply via email to