[compiler-rt] 1cf11df - [memprof] Disable pedantic warnings, suppress variadic macro warning.

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 12:03:47 PST 2021


Author: Snehasish Kumar
Date: 2021-11-30T12:03:19-08:00
New Revision: 1cf11df5912896e9b0c632c86da286513c171114

URL: https://github.com/llvm/llvm-project/commit/1cf11df5912896e9b0c632c86da286513c171114
DIFF: https://github.com/llvm/llvm-project/commit/1cf11df5912896e9b0c632c86da286513c171114.diff

LOG: [memprof] Disable pedantic warnings, suppress variadic macro warning.

The memprof unit tests use an older version of gmock (included in the
repo) which does not build cleanly with -pedantic:
https://github.com/google/googletest/issues/2650
For now just silence the warning by disabling pedantic and add the
appropriate flags for gcc and clang.

Added: 
    

Modified: 
    compiler-rt/lib/memprof/tests/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/memprof/tests/CMakeLists.txt b/compiler-rt/lib/memprof/tests/CMakeLists.txt
index ab6c716bba74..688983e3a3ca 100644
--- a/compiler-rt/lib/memprof/tests/CMakeLists.txt
+++ b/compiler-rt/lib/memprof/tests/CMakeLists.txt
@@ -10,9 +10,13 @@ set(MEMPROF_UNITTEST_CFLAGS
   -O2
   -g
   -fno-rtti
-  -Wno-gnu-zero-variadic-macro-arguments
+  -Wno-pedantic
   -fno-omit-frame-pointer)
 
+# Suppress warnings for gmock variadic macros for clang and gcc respectively.
+append_list_if(SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG -Wno-gnu-zero-variadic-macro-arguments MEMPROF_UNITTEST_CFLAGS)
+append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros MEMPROF_UNITTEST_CFLAGS)
+
 file(GLOB MEMPROF_HEADERS ../*.h)
 
 set(MEMPROF_SOURCES


        


More information about the llvm-commits mailing list