From 402a1bb010522a35600325c1a3084e092b40ca22 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 6 Oct 2014 13:30:31 +0100 Subject: 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] --- src/configparser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/configparser.cpp') 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::iterator j = items.begin(); j != items.end(); ++j) { if(j->first != key) -- cgit v1.2.3