[Lldb-commits] [PATCH] D40757: Disable warnings related to anonymous types

Vedant Kumar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 1 16:35:02 PST 2017


vsk created this revision.
Herald added a subscriber: mgorny.

Various part of lldb make use of anonymous structs and unions. In every case I've seen the usage is idiomatic, and doesn't deserve a warning.

For example, logic in the NSDictionary and NSSet plugins use anonymous structs in a manner consistent with the relevant Apple frameworks.


https://reviews.llvm.org/D40757

Files:
  cmake/modules/LLDBConfig.cmake


Index: cmake/modules/LLDBConfig.cmake
===================================================================
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -231,6 +231,18 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
 endif ()
 
+check_cxx_compiler_flag("-Wno-gnu-anonymous-struct"
+                        CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-anonymous-struct")
+endif ()
+
+check_cxx_compiler_flag("-Wno-nested-anon-types"
+                        CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types")
+endif ()
+
 # Disable MSVC warnings
 if( MSVC )
   add_definitions(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40757.125241.patch
Type: text/x-patch
Size: 808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171202/bb7f23a1/attachment.bin>


More information about the lldb-commits mailing list