diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-02-29 12:40:21 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-02-29 12:40:21 +0100 |
commit | ccd4c11ea1a43d079eaae9708482ef4a9148796c (patch) | |
tree | e66607f44d309e303930985ab5b467806cd93f98 /src/configparser.cpp | |
parent | 515874b0b7cf9a89d3338673ebd37043c10147fe (diff) | |
parent | b972020b391485d92bd46ce662421fa036ca4ca6 (diff) |
Merge pull request #1147 from SaberUK/insp20+gcc6
[2.0] Fix GCC 6 warning about null checking this.
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 94192a71b..409ebdd39 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -388,19 +388,20 @@ bool ParseStack::ParseExec(const std::string& name, int flags, const std::string return ok; } -bool ConfigTag::readString(const std::string& key, std::string& value, bool allow_lf) -{ #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunknown-pragmas" # pragma clang diagnostic ignored "-Wundefined-bool-conversion" +#elif defined __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpragmas" +# pragma GCC diagnostic ignored "-Wnonnull-compare" #endif +bool ConfigTag::readString(const std::string& key, std::string& value, bool allow_lf) +{ // TODO: this is undefined behaviour but changing the API is too risky for 2.0. if (!this) return false; -#ifdef __clang__ -# pragma clang diagnostic pop -#endif for(std::vector<KeyVal>::iterator j = items.begin(); j != items.end(); ++j) { if(j->first != key) @@ -418,6 +419,11 @@ bool ConfigTag::readString(const std::string& key, std::string& value, bool allo } return false; } +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined __GNUC__ +# pragma GCC diagnostic pop +#endif std::string ConfigTag::getString(const std::string& key, const std::string& def) { |