From e5f959ce02a7d82f64b60e72c64db3a20e23b905 Mon Sep 17 00:00:00 2001 From: Vlad Sytchenko Date: Mon, 15 Jun 2020 15:20:30 -0400 Subject: [PATCH] Enable the use of some warnings when building HIP-ROCclr Similar to http://gerrit-git.amd.com/c/compute/ec/vdi/+/375385, except no -Wno-strict-aliasing. With this change only two warnings show up during the build - -Wsign-compare and -Wmisleading-indentation. Change-Id: Iffa436c65ab6312aeaa6def71ee6af38ed1b4a4e [ROCm/clr commit: 509a38f50c63647d5a5b1c1a5ecce4c5192e6bc4] --- projects/clr/hipamd/rocclr/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/rocclr/CMakeLists.txt b/projects/clr/hipamd/rocclr/CMakeLists.txt index 21ce5b1c58..8f1d7ef5c0 100755 --- a/projects/clr/hipamd/rocclr/CMakeLists.txt +++ b/projects/clr/hipamd/rocclr/CMakeLists.txt @@ -21,8 +21,17 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$") add_definitions(-DDEBUG) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options("-Wno-ignored-attributes") +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR + (CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang")) + add_definitions( + # Enabling -Wextra or -pedantic will cause + # thousands of warnings. Keep things simple for now. + -Wall + # This one seems impossible to fix for now. + # There are hundreds of instances of unused vars/functions + # throughout the code base. + -Wno-unused-variable + -Wno-unused-function) endif() set(USE_PROF_API "1")