Fix missing `#pragma GCC diagnostic push`

This commit is contained in:
Martchus 2022-05-21 12:13:01 +02:00
parent 7555e6854b
commit c931e2d928
2 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,7 @@ std::string readFile(std::string_view path, std::string_view::size_type maxSize)
file.seekg(ios_base::beg);
// ignore warning about null pointer dereference from GCC 12 for now (which is *likely* not correct)
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
res.assign((istreambuf_iterator<char>(file)), istreambuf_iterator<char>());

View File

@ -448,6 +448,7 @@ void IoTests::testAdvancedIniFile()
inputFile.seekg(std::ios_base::beg);
// ignore warning about null pointer dereference from GCC 12 for now (which is *likely* not correct)
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
originalContents.assign((istreambuf_iterator<char>(inputFile)), istreambuf_iterator<char>());