mirror of
https://github.com/google/benchmark.git
synced 2025-01-14 22:00:33 +08:00
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.
This commit is contained in:
parent
140fc22ab2
commit
c408461983
@ -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(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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(
|
|||||||
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[]) {
|
|||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user