Suppress -Wformat-overflow warning/error

GCC 7 and later warn about overflow/truncation when using
sprintf and related functions with fixed-size buffers.

Suppress the warning in schematest.cpp.
This commit is contained in:
Philipp A Hartmann 2018-07-15 16:02:03 +02:00 committed by Philipp A Hartmann
parent a26267d16d
commit 152511689b

View File

@ -11,6 +11,11 @@
using namespace rapidjson;
RAPIDJSON_DIAG_PUSH
#if defined(__GNUC__) && __GNUC__ >= 7
RAPIDJSON_DIAG_OFF(format-overflow)
#endif
template <typename Allocator>
static char* ReadFile(const char* filename, Allocator& allocator) {
const char *paths[] = {
@ -42,6 +47,8 @@ static char* ReadFile(const char* filename, Allocator& allocator) {
return json;
}
RAPIDJSON_DIAG_POP
class Schema : public PerfTest {
public:
Schema() {}