Unify Wformat suppression for libunwind
authorAdeel <adeelbm@outlook.com>
Thu, 2 May 2019 04:56:20 +0000 (04:56 +0000)
committerAdeel <adeelbm@outlook.com>
Thu, 2 May 2019 04:56:42 +0000 (04:56 +0000)
src/pal/src/libunwind/src/CMakeLists.txt

index 98d3d3e..b29e7ee 100644 (file)
@@ -7,11 +7,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 include(configure.cmake)
 
-if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-  add_compile_options(-Wformat=0)
-  add_compile_options(-Wno-unused-value)
-endif()
-
 # The HAVE___THREAD set to 1 causes creation of thread local variable with tls_model("initial-exec")
 # which is incompatible with usage of the unwind code in a shared library.
 add_definitions(-DHAVE___THREAD=0)
@@ -24,8 +19,13 @@ add_definitions(-D_GNU_SOURCE)
 # Ensure that the remote and local unwind code can reside in the same binary without name clashing
 add_definitions("-Ddwarf_search_unwind_table_int=UNW_OBJ(dwarf_search_unwind_table_int)")
 
+# Disable warning due to incorrect format specifier in debugging printf via the Debug macro
+add_compile_options(-Wno-format)
+
 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   add_compile_options(-Wno-header-guard)
+elseif()
+  add_compile_options(-Wno-unused-value)
 endif()
 
 if(CLR_CMAKE_PLATFORM_ARCH_ARM)
@@ -37,8 +37,6 @@ if(CLR_CMAKE_PLATFORM_ARCH_ARM)
         # Disable warning due to labs function called on unsigned argument
         add_compile_options(-Wno-absolute-value)
     endif()
-    # Disable warning due to incorrect format specifier in debugging printf via the Debug macro
-    add_compile_options(-Wno-format)
     # Disable warning for a bug in the libunwind source src/arm/Gtrace.c:529, but not in code that we exercise
     add_compile_options(-Wno-implicit-function-declaration)
     # Disable warning due to an unused function prel31_read
@@ -57,8 +55,6 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
     # We compile code with -std=c99 and the asm keyword is not recognized as it is a gnu extension
     add_definitions(-Dasm=__asm__)
 elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
-    # Disable warning due to incorrect format specifier in debugging printf via the Debug macro
-    add_compile_options(-Wno-format)
     # Disable warning for a bug in the libunwind source src/x86/Gos-linux.c, but not in code that we exercise
     add_compile_options(-Wno-incompatible-pointer-types)
 endif()