Bug #97468 | clang 5.0.1 reports "missing-braces" warnings | ||
---|---|---|---|
Submitted: | 4 Nov 2019 11:08 | Modified: | 5 Nov 2019 14:01 |
Reporter: | Przemysław Skibiński (OCA) | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 8.0.18 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[4 Nov 2019 11:08]
Przemysław Skibiński
[4 Nov 2019 12:50]
MySQL Verification Team
Thank you for the bug report. miguel@tikal:~/tmp/mysql-8.0.18$ make > compile-log.txt /home/miguel/tmp/mysql-8.0.18/storage/innobase/clone/clone0api.cc:1852:36: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] Fixup_data::s_config_tables = {"slave_relay_log_info", "slave_worker_info"}; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { }
[5 Nov 2019 10:13]
Jon Olav Hauglid
Posted by developer: Thanks for the bug report! Repeatable with Clang 5, but not with Clang 6, 7, 8 and 9. For this reason, we prefer not to turn -Wmissing-braces off since it is useful to us with newer versions of Clang.
[5 Nov 2019 14:01]
Przemysław Skibiński
The warning can be disabled only for clang-5 or older: diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 55e8566bccc..b64482d119c 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -89,6 +89,11 @@ IF(MY_COMPILER_IS_CLANG) STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wno-null-conversion") STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wno-unused-private-field") + # clang-5 or older: disable "suggest braces around initialization of subobject" warnings + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6) + STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wno-missing-braces") + ENDIF() + STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wconditional-uninitialized") STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wdeprecated") STRING_APPEND(MY_CXX_WARNING_FLAGS " -Wextra-semi")