]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: use fmt::format_to(...) to fix FTBFS on gcc 13
authorTim Serong <tserong@suse.com>
Wed, 8 Mar 2023 02:45:57 +0000 (13:45 +1100)
committerCasey Bodley <cbodley@redhat.com>
Mon, 19 Jun 2023 18:51:11 +0000 (14:51 -0400)
commit6f137f5344de54e67c14073595ba3bef46b0d84f
tree1ccbd148cabf1d20f971c71a79638224cc0f6380
parent5f294ed63642abc8781d17a6f4e3b6795c486df6
osd: use fmt::format_to(...) to fix FTBFS on gcc 13

Without this the build will fail on gcc 13 with errors like:

src/osd/scrubber/scrub_backend.cc:1309:14: error: call of overloaded 'format_to(std::back_insert_iterator<fmt::v9::basic_memory_buffer<char> >, const char [35], const char*, const uint64_t&, const uint64_t&, pg_shard_t&)' is ambiguous
  1309 |     format_to(std::back_inserter(out),
       |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
  1310 |               "{}size {} != size {} from shard {}",
       |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1311 |               sep(error),
       |               ~~~~~~~~~~~
  1312 |               candidate.size,
       |               ~~~~~~~~~~~~~~~
  1313 |               auth.size,
       |               ~~~~~~~~~~
  1314 |               auth_shard);
       |               ~~~~~~~~~~~
 /usr/include/fmt/core.h:3233:17: note: candidate: 'OutputIt fmt::v9::format_to(OutputIt, format_string<T ...>, T&& ...) [with OutputIt = std::back_insert_iterator<basic_memory_buffer<char> >; T = {const char*, const long unsigned int&, const long unsigned int&, pg_shard_t&}; typename std::enable_if<detail::is_output_iterator<OutputIt, char>::value, int>::type <anonymous> = 0; format_string<T ...> = basic_format_string<char, const char*, const long unsigned int&, const long unsigned int&, pg_shard_t&>]'
 3233 | FMT_INLINE auto format_to(OutputIt out, format_string<T...> fmt, T&&... args)
      |                 ^~~~~~~~~
 /usr/include/c++/13/format:3761:5: note: candidate: '_Out std::format_to(_Out, format_string<_Args ...>, _Args&& ...) [with _Out = back_insert_iterator<fmt::v9::basic_memory_buffer<char> >; _Args = {const char*, const long unsigned int&, const long unsigned int&, pg_shard_t&}; format_string<_Args ...> = basic_format_string<char, const char*, const long unsigned int&, const long unsigned int&, pg_shard_t&>]'
  3761 |     format_to(_Out __out, format_string<_Args...> __fmt, _Args&&... __args)
       |     ^~~~~~~~~

Fixes: https://tracker.ceph.com/issues/58477
Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 1ae8eb68c21b7df0bc7c38035176f2447dffaed2)
src/osd/scrubber/scrub_backend.cc
src/osd/scrubber/scrub_backend.h