Commit c4084619 by Eric Fiselier

Disable deprecated warnings when touching CSVReporter internally.

The CSVReporter is deprecated, but we still need to reference it in a few places. To avoid breaking the build when warnings are errors, we need to disable the warning when we do so.
parent 140fc22a
...@@ -289,6 +289,13 @@ void RunBenchmarks(const std::vector<BenchmarkInstance>& benchmarks, ...@@ -289,6 +289,13 @@ void RunBenchmarks(const std::vector<BenchmarkInstance>& benchmarks,
flushStreams(file_reporter); flushStreams(file_reporter);
} }
// Disable deprecated warnings temporarily because we need to reference
// CSVReporter but don't want to trigger -Werror=-Wdeprecated
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif
std::unique_ptr<BenchmarkReporter> CreateReporter( std::unique_ptr<BenchmarkReporter> CreateReporter(
std::string const& name, ConsoleReporter::OutputOptions output_opts) { std::string const& name, ConsoleReporter::OutputOptions output_opts) {
typedef std::unique_ptr<BenchmarkReporter> PtrType; typedef std::unique_ptr<BenchmarkReporter> PtrType;
...@@ -304,6 +311,11 @@ std::unique_ptr<BenchmarkReporter> CreateReporter( ...@@ -304,6 +311,11 @@ std::unique_ptr<BenchmarkReporter> CreateReporter(
} }
} }
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
} // end namespace } // end namespace
bool IsZero(double n) { bool IsZero(double n) {
......
...@@ -373,6 +373,12 @@ int SetSubstitutions( ...@@ -373,6 +373,12 @@ int SetSubstitutions(
return 0; return 0;
} }
// Disable deprecated warnings temporarily because we need to reference
// CSVReporter but don't want to trigger -Werror=-Wdeprecated
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif
void RunOutputTests(int argc, char* argv[]) { void RunOutputTests(int argc, char* argv[]) {
using internal::GetTestCaseList; using internal::GetTestCaseList;
benchmark::Initialize(&argc, argv); benchmark::Initialize(&argc, argv);
...@@ -431,6 +437,10 @@ void RunOutputTests(int argc, char* argv[]) { ...@@ -431,6 +437,10 @@ void RunOutputTests(int argc, char* argv[]) {
internal::GetResultsChecker().CheckResults(csv.out_stream); internal::GetResultsChecker().CheckResults(csv.out_stream);
} }
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
int SubstrCnt(const std::string& haystack, const std::string& pat) { int SubstrCnt(const std::string& haystack, const std::string& pat) {
if (pat.length() == 0) return 0; if (pat.length() == 0) return 0;
int count = 0; int count = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment