<div dir="ltr">Hey Hans, Jonathan;<div><br></div><div>This seems like it might be a good candidate for merging into the release.<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 17, 2015 at 8:14 PM Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chandlerc<br>
Date: Fri Jul 17 22:14:02 2015<br>
New Revision: 242604<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D242604-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=wamunMHiezyyax7_-cqld9ni6rtpp1PPRuf6Dji4I7s&m=uEiRLTJnDiJfoQqBHNfV7QsNwYw2RFGa_0wJPF8ynVc&s=-IGM1IlNCh2fVSQrkZ6y6CK5yYbwrHvaZoQOgQ6qTWQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=242604&view=rev</a><br>
Log:<br>
[cmake] Support enabling -Werror in the OpenMP runtime CMake build and<br>
clean up the build.<br>
<br>
This disables all of the Clang warnings that fire for me when building<br>
libomp.so on Linux with a recent Clang binary. Lots of these should<br>
probably be fixed, but I want to at least get the build warning-clean<br>
and make it easy to keep that way.<br>
<br>
I also switched a bunch of the warnings that are used both for C and C++<br>
compiles to check the flag with C compilation test.<br>
<br>
Differential Revision: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11253&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=wamunMHiezyyax7_-cqld9ni6rtpp1PPRuf6Dji4I7s&m=uEiRLTJnDiJfoQqBHNfV7QsNwYw2RFGa_0wJPF8ynVc&s=d3b7hYX54i38_yT3yjtxSmC7fE7A9mb11ck-V1QEXqM&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D11253</a><br>
<br>
Modified:<br>
openmp/trunk/runtime/CMakeLists.txt<br>
openmp/trunk/runtime/cmake/LibompHandleFlags.cmake<br>
openmp/trunk/runtime/cmake/config-ix.cmake<br>
<br>
Modified: openmp/trunk/runtime/CMakeLists.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_openmp_trunk_runtime_CMakeLists.txt-3Frev-3D242604-26r1-3D242603-26r2-3D242604-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=wamunMHiezyyax7_-cqld9ni6rtpp1PPRuf6Dji4I7s&m=uEiRLTJnDiJfoQqBHNfV7QsNwYw2RFGa_0wJPF8ynVc&s=__OA7IBCHq7JOjaCuIV5h2K0sukSHgYo1wAwhDxAKvI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/CMakeLists.txt?rev=242604&r1=242603&r2=242604&view=diff</a><br>
==============================================================================<br>
--- openmp/trunk/runtime/CMakeLists.txt (original)<br>
+++ openmp/trunk/runtime/CMakeLists.txt Fri Jul 17 22:14:02 2015<br>
@@ -41,6 +41,8 @@ if(${LIBOMP_STANDALONE_BUILD})<br>
# Should assertions be enabled? They are on by default.<br>
set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL<br>
"enable assertions?")<br>
+ set(LIBOMP_ENABLE_WERROR FALSE CACHE BOOL<br>
+ "Enable -Werror flags to turn warnings into errors for supporting compilers.")<br>
# CMAKE_BUILD_TYPE was not defined, set default to Release<br>
if(NOT CMAKE_BUILD_TYPE)<br>
set(CMAKE_BUILD_TYPE Release)<br>
@@ -73,6 +75,7 @@ else() # Part of LLVM build<br>
endif ()<br>
set(LIBOMP_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})<br>
set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS})<br>
+ set(LIBOMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})<br>
endif()<br>
libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc64 ppc64le aarch64 mic)<br>
<br>
<br>
Modified: openmp/trunk/runtime/cmake/LibompHandleFlags.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_openmp_trunk_runtime_cmake_LibompHandleFlags.cmake-3Frev-3D242604-26r1-3D242603-26r2-3D242604-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=wamunMHiezyyax7_-cqld9ni6rtpp1PPRuf6Dji4I7s&m=uEiRLTJnDiJfoQqBHNfV7QsNwYw2RFGa_0wJPF8ynVc&s=HiKTfUDpnQ-DoVzzSq5Tkk7kazH9f2XvkOgrvQsHgEM&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/LibompHandleFlags.cmake?rev=242604&r1=242603&r2=242604&view=diff</a><br>
==============================================================================<br>
--- openmp/trunk/runtime/cmake/LibompHandleFlags.cmake (original)<br>
+++ openmp/trunk/runtime/cmake/LibompHandleFlags.cmake Fri Jul 17 22:14:02 2015<br>
@@ -28,10 +28,25 @@ function(libomp_get_c_and_cxxflags_commo<br>
set(flags_local)<br>
libomp_append(flags_local -std=c++11 LIBOMP_HAVE_STD_CPP11_FLAG)<br>
libomp_append(flags_local -fno-exceptions LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG)<br>
- libomp_append(flags_local -Wsign-compare LIBOMP_HAVE_WSIGN_COMPARE_FLAG)<br>
+ if(${LIBOMP_ENABLE_WERROR})<br>
+ libomp_append(flags_local -Werror LIBOMP_HAVE_WERROR_FLAG)<br>
+ endif()<br>
+ libomp_append(flags_local -Wno-sign-compare LIBOMP_HAVE_WNO_SIGN_COMPARE_FLAG)<br>
+ libomp_append(flags_local -Wno-unused-function LIBOMP_HAVE_WNO_UNUSED_FUNCTION_FLAG)<br>
+ libomp_append(flags_local -Wno-unused-local-typedef LIBOMP_HAVE_WNO_UNUSED_LOCAL_TYPEDEF_FLAG)<br>
libomp_append(flags_local -Wno-unused-value LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG)<br>
+ libomp_append(flags_local -Wno-unused-variable LIBOMP_HAVE_WNO_UNUSED_VARIABLE_FLAG)<br>
libomp_append(flags_local -Wno-switch LIBOMP_HAVE_WNO_SWITCH_FLAG)<br>
+ libomp_append(flags_local -Wno-covered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)<br>
libomp_append(flags_local -Wno-deprecated-register LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG)<br>
+ libomp_append(flags_local -Wno-gnu-anonymous-struct LIBOMP_HAVE_WNO_GNU_ANONYMOUS_STRUCT_FLAG)<br>
+ libomp_append(flags_local -Wno-unknown-pragmas LIBOMP_HAVE_WNO_UNKNOWN_PRAGMAS_FLAG)<br>
+ libomp_append(flags_local -Wno-missing-field-initializers LIBOMP_HAVE_WNO_MISSING_FIELD_INITIALIZERS_FLAG)<br>
+ libomp_append(flags_local -Wno-missing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)<br>
+ libomp_append(flags_local -Wno-comment LIBOMP_HAVE_WNO_COMMENT_FLAG)<br>
+ libomp_append(flags_local -Wno-self-assign LIBOMP_HAVE_WNO_SELF_ASSIGN_FLAG)<br>
+ libomp_append(flags_local -Wno-vla-extension LIBOMP_HAVE_WNO_VLA_EXTENSION_FLAG)<br>
+ libomp_append(flags_local -Wno-format-pedantic LIBOMP_HAVE_WNO_FORMAT_PEDANTIC_FLAG)<br>
libomp_append(flags_local /GS LIBOMP_HAVE_GS_FLAG)<br>
libomp_append(flags_local /EHsc LIBOMP_HAVE_EHSC_FLAG)<br>
libomp_append(flags_local /Oy- LIBOMP_HAVE_OY__FLAG)<br>
<br>
Modified: openmp/trunk/runtime/cmake/config-ix.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_openmp_trunk_runtime_cmake_config-2Dix.cmake-3Frev-3D242604-26r1-3D242603-26r2-3D242604-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=wamunMHiezyyax7_-cqld9ni6rtpp1PPRuf6Dji4I7s&m=uEiRLTJnDiJfoQqBHNfV7QsNwYw2RFGa_0wJPF8ynVc&s=FT4EZIipERFgMLObhWXryDu3TzDqomv9cfIIW4H_7jw&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/config-ix.cmake?rev=242604&r1=242603&r2=242604&view=diff</a><br>
==============================================================================<br>
--- openmp/trunk/runtime/cmake/config-ix.cmake (original)<br>
+++ openmp/trunk/runtime/cmake/config-ix.cmake Fri Jul 17 22:14:02 2015<br>
@@ -48,12 +48,25 @@ endfunction()<br>
check_cxx_compiler_flag(-std=c++11 LIBOMP_HAVE_STD_CPP11_FLAG)<br>
check_cxx_compiler_flag(-fno-exceptions LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG)<br>
check_c_compiler_flag("-x c++" LIBOMP_HAVE_X_CPP_FLAG)<br>
-check_cxx_compiler_flag(-Wunused-value LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG)<br>
-check_cxx_compiler_flag(-Wswitch LIBOMP_HAVE_WNO_SWITCH_FLAG)<br>
-check_cxx_compiler_flag(-Wdeprecated-register LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG)<br>
-check_cxx_compiler_flag(-Wsign-compare LIBOMP_HAVE_WSIGN_COMPARE_FLAG)<br>
-check_cxx_compiler_flag(-msse2 LIBOMP_HAVE_MSSE2_FLAG)<br>
-check_cxx_compiler_flag(-ftls-model=initial-exec LIBOMP_HAVE_FTLS_MODEL_FLAG)<br>
+check_c_compiler_flag(-Werror LIBOMP_HAVE_WERROR_FLAG)<br>
+check_c_compiler_flag(-Wunused-function LIBOMP_HAVE_WNO_UNUSED_FUNCTION_FLAG)<br>
+check_c_compiler_flag(-Wunused-local-typedef LIBOMP_HAVE_WNO_UNUSED_LOCAL_TYPEDEF_FLAG)<br>
+check_c_compiler_flag(-Wunused-value LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG)<br>
+check_c_compiler_flag(-Wunused-variable LIBOMP_HAVE_WNO_UNUSED_VARIABLE_FLAG)<br>
+check_c_compiler_flag(-Wswitch LIBOMP_HAVE_WNO_SWITCH_FLAG)<br>
+check_c_compiler_flag(-Wcovered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)<br>
+check_c_compiler_flag(-Wdeprecated-register LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG)<br>
+check_c_compiler_flag(-Wsign-compare LIBOMP_HAVE_WNO_SIGN_COMPARE_FLAG)<br>
+check_c_compiler_flag(-Wgnu-anonymous-struct LIBOMP_HAVE_WNO_GNU_ANONYMOUS_STRUCT_FLAG)<br>
+check_c_compiler_flag(-Wunknown-pragmas LIBOMP_HAVE_WNO_UNKNOWN_PRAGMAS_FLAG)<br>
+check_c_compiler_flag(-Wmissing-field-initializers LIBOMP_HAVE_WNO_MISSING_FIELD_INITIALIZERS_FLAG)<br>
+check_c_compiler_flag(-Wmissing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)<br>
+check_c_compiler_flag(-Wcomment LIBOMP_HAVE_WNO_COMMENT_FLAG)<br>
+check_c_compiler_flag(-Wself-assign LIBOMP_HAVE_WNO_SELF_ASSIGN_FLAG)<br>
+check_c_compiler_flag(-Wvla-extension LIBOMP_HAVE_WNO_VLA_EXTENSION_FLAG)<br>
+check_c_compiler_flag(-Wformat-pedantic LIBOMP_HAVE_WNO_FORMAT_PEDANTIC_FLAG)<br>
+check_c_compiler_flag(-msse2 LIBOMP_HAVE_MSSE2_FLAG)<br>
+check_c_compiler_flag(-ftls-model=initial-exec LIBOMP_HAVE_FTLS_MODEL_FLAG)<br>
libomp_check_architecture_flag(-mmic LIBOMP_HAVE_MMIC_FLAG)<br>
libomp_check_architecture_flag(-m32 LIBOMP_HAVE_M32_FLAG)<br>
if(WIN32)<br>
<br>
<br>
_______________________________________________<br>
Openmp-commits mailing list<br>
<a href="mailto:Openmp-commits@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-commits@dcs-maillist2.engr.illinois.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/openmp-commits</a><br>
</blockquote></div></div></div>