From: Adam Simpkins Date: Wed, 10 Jan 2018 20:29:05 +0000 (-0800) Subject: logging: fix build error when using gcc with -Wmissing-braces X-Git-Tag: v2018.01.15.00~20 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=79a92dfdb43fefd774ea8f51bd6b9a2b9d0ce137 logging: fix build error when using gcc with -Wmissing-braces Summary: Since std::array is actually a struct containing an array it technically requires double braces around its initializer. The language allows eliding these braces, and clang doesn't complain about only using a single brace, but gcc does when using `-Wmissing-braces`. Reviewed By: yfeldblum Differential Revision: D6695289 fbshipit-source-id: 913fcfbea4164a02d001bd2344e340c0b6ee62aa --- diff --git a/folly/experimental/logging/LogLevel.cpp b/folly/experimental/logging/LogLevel.cpp index fc09b006..e8fc5e6e 100644 --- a/folly/experimental/logging/LogLevel.cpp +++ b/folly/experimental/logging/LogLevel.cpp @@ -33,10 +33,10 @@ struct NumberedLevelInfo { StringPiece upperPrefix; }; -constexpr std::array numberedLogLevels = { +constexpr std::array numberedLogLevels = {{ NumberedLevelInfo{LogLevel::DBG, LogLevel::DBG0, "dbg", "DBG"}, NumberedLevelInfo{LogLevel::INFO, LogLevel::INFO0, "info", "INFO"}, -}; +}}; } // namespace LogLevel stringToLogLevel(StringPiece name) {