[3/N] Enforce unused-function and unused-variable checks (#130084)

Follows #129878.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130084
Approved by: https://github.com/ezyang
This commit is contained in:
cyy 2024-07-05 23:56:00 +00:00 committed by PyTorch MergeBot
parent 126796d239
commit e5841bb8d5

View File

@ -464,7 +464,12 @@ function(torch_compile_options libname)
list(APPEND private_compile_options
-Wno-strict-overflow
-Werror=inconsistent-missing-override
-Werror=inconsistent-missing-destructor-override)
-Werror=inconsistent-missing-destructor-override
-Werror=unused-function
-Werror=unused-variable)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND private_compile_options -Werror=unused-but-set-variable)
endif()
endif()
endif()