[Lldb-commits] [PATCH] D58680: [lldb] [unittests] Silence -Wformat-zero-length warnings in UtilityTests
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 26 08:43:01 PST 2019
mgorny created this revision.
mgorny added reviewers: labath, zturner, teemperor.
mgorny added a project: LLDB.
Herald added subscribers: jdoerfert, abidh.
Silence zero-length format warnings in UtilityTests reported by GCC.
Zero-length format strings are permitted by the standards, and are used
purposedly in the tests.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D58680
Files:
lldb/cmake/modules/LLDBConfig.cmake
lldb/unittests/Utility/CMakeLists.txt
Index: lldb/unittests/Utility/CMakeLists.txt
===================================================================
--- lldb/unittests/Utility/CMakeLists.txt
+++ lldb/unittests/Utility/CMakeLists.txt
@@ -1,3 +1,7 @@
+if(CXX_SUPPORTS_NO_FORMAT_ZERO_LENGTH)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-zero-length")
+endif()
+
add_lldb_unittest(UtilityTests
AnsiTerminalTest.cpp
ArgsTest.cpp
Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -278,6 +278,9 @@
check_cxx_compiler_flag("-Wno-nested-anon-types"
CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+check_cxx_compiler_flag("-Wno-format-zero-length"
+ CXX_SUPPORTS_NO_FORMAT_ZERO_LENGTH)
+
# Disable MSVC warnings
if( MSVC )
add_definitions(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58680.188388.patch
Type: text/x-patch
Size: 899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190226/04110a3d/attachment-0001.bin>
More information about the lldb-commits
mailing list