mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Compile C10 with Wshadow (#86666)
This should prevent further regressions like https://github.com/pytorch/pytorch/pull/86646 Update `fmt` to `7.1.0` to fix variable shadowing in that library Pull Request resolved: https://github.com/pytorch/pytorch/pull/86666 Approved by: https://github.com/seemethere
This commit is contained in:
parent
0337f0ad47
commit
09364f4298
|
|
@ -927,9 +927,6 @@ if(NOT MSVC)
|
|||
append_cxx_flag_if_supported("-fno-trapping-math" CMAKE_CXX_FLAGS)
|
||||
append_cxx_flag_if_supported("-Werror=format" CMAKE_CXX_FLAGS)
|
||||
append_cxx_flag_if_supported("-Werror=cast-function-type" CMAKE_CXX_FLAGS)
|
||||
check_cxx_compiler_flag("-Werror=sign-compare" HAS_WERROR_SIGN_COMPARE)
|
||||
# This doesn't work globally so we use the test on specific
|
||||
# target_compile_options
|
||||
endif()
|
||||
|
||||
if(USE_ASAN)
|
||||
|
|
|
|||
|
|
@ -52,8 +52,9 @@ target_compile_options(c10 PRIVATE "-DC10_BUILD_MAIN_LIB")
|
|||
if(${COMPILER_SUPPORTS_HIDDEN_VISIBILITY})
|
||||
target_compile_options(c10 PRIVATE "-fvisibility=hidden")
|
||||
endif()
|
||||
if(HAS_WERROR_SIGN_COMPARE AND WERROR)
|
||||
target_compile_options(c10 PRIVATE "-Werror=sign-compare")
|
||||
if(WERROR)
|
||||
target_compile_options_if_supported(c10 PRIVATE "-Werror=sign-compare")
|
||||
target_compile_options_if_supported(c10 PRIVATE "-Werror=shadow")
|
||||
endif()
|
||||
|
||||
# ---[ Dependency of c10
|
||||
|
|
|
|||
2
third_party/fmt
vendored
2
third_party/fmt
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit cd4af11efc9c622896a3e4cb599fa28668ca3d05
|
||||
Subproject commit 7bdf0628b1276379886c7f6dda2cef2b3b374f0b
|
||||
Loading…
Reference in New Issue
Block a user