Fixed "maybe-uninitialized" warning (fixes #1217)

This commit is contained in:
Benoit Blanchon
2020-03-25 08:37:57 +01:00
parent 8b3d861a9d
commit fc9e609ab5
7 changed files with 91 additions and 25 deletions

View File

@@ -10,6 +10,16 @@
#include <ArduinoJson/Strings/RamStringAdapter.hpp>
#include <ArduinoJson/Variant/VariantContent.hpp>
// VariantData can't have a constructor (to be a POD), so we have no way to fix
// this warning
#if defined(__GNUC__)
#if __GNUC__ >= 7
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif
#endif
namespace ARDUINOJSON_NAMESPACE {
class VariantData {
@@ -383,3 +393,9 @@ class VariantData {
};
} // namespace ARDUINOJSON_NAMESPACE
#if defined(__GNUC__)
#if __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
#endif