diff options
author | Peter Powell <petpow@saberuk.com> | 2014-10-06 13:30:31 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2014-10-13 06:18:10 +0100 |
commit | 402a1bb010522a35600325c1a3084e092b40ca22 (patch) | |
tree | 5c276225f1c2d6758ae813e14a744b816f1ece2d /src/configparser.cpp | |
parent | 529d26bdafb033a3f90691d21f609067261bb953 (diff) |
Fix various warnings when building with LLVM 3.5.
- warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
- warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 825dfc966..94192a71b 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -390,8 +390,17 @@ bool ParseStack::ParseExec(const std::string& name, int flags, const std::string 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" +#endif + // 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) |