Commit e9ca71c7 authored by Kamal Marhubi's avatar Kamal Marhubi

Stop clang warning -Wglobal-constructors on JSON codec

parent cd8c3b74
......@@ -658,11 +658,22 @@ private:
}; // class Parser
// clang warns about these constructors running on program start. All they do is each set a pointer
// and a size_t, so we politely ask clang to let it slide.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
// Array literal used instead of string literal to avoid null terminator.
const kj::ArrayPtr<const char> Parser::NULL_ = kj::ArrayPtr<const char>({'n','u','l','l'});
const kj::ArrayPtr<const char> Parser::FALSE = kj::ArrayPtr<const char>({'f','a','l','s','e'});
const kj::ArrayPtr<const char> Parser::TRUE = kj::ArrayPtr<const char>({'t','r','u','e'});
#ifdef __clang__
#pragma clang diagnostic pop
#endif
} // namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment