From ccc03dd1ec04d75faaf761e079c5f17477f7999e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 30 Jan 2023 20:54:36 +0800 Subject: [PATCH 1/2] cql3, locator: call fmt::format_to() explicitly since format_to() is defined included by both fmt and std namepaces, without specifying which one to use, we'd fail to build with the standard library which implements std::format_to(). yes, we are `using namespace std` somewhere. this change should address the FTBFS with GCC-13. Signed-off-by: Kefu Chai --- cql3/expr/expression.hh | 10 +++++----- locator/abstract_replication_strategy.hh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cql3/expr/expression.hh b/cql3/expr/expression.hh index a8152ad0b4..7a04db1965 100644 --- a/cql3/expr/expression.hh +++ b/cql3/expr/expression.hh @@ -821,10 +821,10 @@ struct fmt::formatter { } template - auto format(const cql3::expr::expression& expr, FormatContext& ctx) { + auto format(const cql3::expr::expression& expr, FormatContext& ctx) const { std::ostringstream os; os << expr; - return format_to(ctx.out(), "{}", os.str()); + return fmt::format_to(ctx.out(), "{}", os.str()); } }; @@ -836,10 +836,10 @@ struct fmt::formatter { } template - auto format(const cql3::expr::expression::printer& pr, FormatContext& ctx) { + auto format(const cql3::expr::expression::printer& pr, FormatContext& ctx) const { std::ostringstream os; os << pr; - return format_to(ctx.out(), "{}", os.str()); + return fmt::format_to(ctx.out(), "{}", os.str()); } }; @@ -854,6 +854,6 @@ struct fmt::formatter { auto format(const cql3::expr::column_value& col, FormatContext& ctx) { std::ostringstream os; os << col; - return format_to(ctx.out(), "{}", os.str()); + return fmt::format_to(ctx.out(), "{}", os.str()); } }; diff --git a/locator/abstract_replication_strategy.hh b/locator/abstract_replication_strategy.hh index 5a7e7bce3f..9910442cad 100644 --- a/locator/abstract_replication_strategy.hh +++ b/locator/abstract_replication_strategy.hh @@ -308,7 +308,7 @@ struct fmt::formatter { auto format(const locator::effective_replication_map::factory_key& key, FormatContext& ctx) { std::ostringstream os; os << key; - return format_to(ctx.out(), "{}", os.str()); + return fmt::format_to(ctx.out(), "{}", os.str()); } }; From 58b4dc5b9a9d6e8bea02e2389c6634ebe7fbb657 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 30 Jan 2023 20:56:41 +0800 Subject: [PATCH 2/2] cql3/stats: include the used header. otherwise `uint64_t` won't be found when compiling with GCC-13. Signed-off-by: Kefu Chai --- cql3/stats.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cql3/stats.hh b/cql3/stats.hh index dfac753feb..271f02a0e1 100644 --- a/cql3/stats.hh +++ b/cql3/stats.hh @@ -12,6 +12,8 @@ #include "cql3/statements/statement_type.hh" +#include + namespace cql3 { /** Enums for selecting counters in `cql_stats', like: