mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Suppress common warnings when building by clang (#69710)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69710 Namely no range-loop-analysis (that detect when loop variable can not be const reference Test Plan: Imported from OSS Reviewed By: r-barnes Differential Revision: D32997003 Pulled By: malfet fbshipit-source-id: dba0e7875e5b667e2cc394c70dd75e2403265918
This commit is contained in:
parent
41c344d460
commit
e305e4d4d8
|
|
@ -768,6 +768,10 @@ if(NOT MSVC)
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-strict-overflow")
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-strict-overflow")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-strict-aliasing")
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-strict-aliasing")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-error=deprecated-declarations")
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-error=deprecated-declarations")
|
||||||
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-range-loop-analysis")
|
||||||
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-pass-failed")
|
||||||
|
endif()
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0))
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0))
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-stringop-overflow")
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-stringop-overflow")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-noexcept-type")
|
string(APPEND CMAKE_CXX_FLAGS " -Wno-noexcept-type")
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,10 @@ function(torch_compile_options libname)
|
||||||
# warnings, see https://bugs.llvm.org/show_bug.cgi?id=21629
|
# warnings, see https://bugs.llvm.org/show_bug.cgi?id=21629
|
||||||
-Wno-missing-braces
|
-Wno-missing-braces
|
||||||
)
|
)
|
||||||
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
list(APPEND private_compile_options
|
||||||
|
-Wno-range-loop-analysis)
|
||||||
|
endif()
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
list(APPEND private_compile_options
|
list(APPEND private_compile_options
|
||||||
# Considered to be flaky. See the discussion at
|
# Considered to be flaky. See the discussion at
|
||||||
|
|
|
||||||
|
|
@ -105,10 +105,11 @@ else()
|
||||||
-fno-strict-aliasing
|
-fno-strict-aliasing
|
||||||
-Wno-write-strings
|
-Wno-write-strings
|
||||||
-Wno-strict-aliasing)
|
-Wno-strict-aliasing)
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
endif()
|
||||||
list(APPEND TORCH_PYTHON_COMPILE_OPTIONS
|
|
||||||
-Wno-writable-strings)
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
endif()
|
list(APPEND TORCH_PYTHON_COMPILE_OPTIONS
|
||||||
|
-Wno-writable-strings)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_CUDA)
|
if(USE_CUDA)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user