From 7a10e31982a886a668827ab7dc5c7bff249861c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Ferenc=20Nagy-Egri?= Date: Wed, 24 Feb 2021 09:45:35 +0100 Subject: [PATCH] Avoid relying on function name decay mechanics --- bench/formatter-bench.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bench/formatter-bench.cpp b/bench/formatter-bench.cpp index 34407c10..1454c6bb 100644 --- a/bench/formatter-bench.cpp +++ b/bench/formatter-bench.cpp @@ -34,14 +34,14 @@ void bench_formatters() for (auto &flag : all_flags) { auto pattern = std::string("%") + flag; - benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern); + benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern); // pattern = std::string("%16") + flag; - // benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern); + // benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern); // // // bench center padding // pattern = std::string("%=16") + flag; - // benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern); + // benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern); } // complex patterns @@ -52,7 +52,7 @@ void bench_formatters() }; for (auto &pattern : patterns) { - benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern)->Iterations(2500000); + benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern)->Iterations(2500000); } } @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) } else { - benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern); + benchmark::RegisterBenchmark(pattern.c_str(), &bench_formatter, pattern); } benchmark::Initialize(&argc, argv); benchmark::RunSpecifiedBenchmarks();