Adding Wunused-local-typedef build flag (#86154)

# Summary

In the past, we have seen PRs causing internal breakages caused by `-Wunused-local-typedef` flag which than had to be fixed. For example: [#79978](https://github.com/pytorch/pytorch/pull/79978)

As part of this change, we want to catch this error in the PR Checks itself.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/86154
Approved by: https://github.com/huydhn, https://github.com/seemethere, https://github.com/osalpekar
This commit is contained in:
Nirav Mehta
2022-10-04 19:43:54 +00:00
committed by PyTorch MergeBot
parent 8da704cdb7
commit d724a91935
2 changed files with 2 additions and 1 deletions

View File

@ -832,6 +832,7 @@ if(NOT MSVC)
append_cxx_flag_if_supported("-Wno-type-limits" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-array-bounds" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wunused-local-typedefs" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-unused-parameter" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-unused-function" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-unused-result" CMAKE_CXX_FLAGS)
@ -895,6 +896,7 @@ if(NOT MSVC)
append_cxx_flag_if_supported("-Wno-constexpr-not-const" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-missing-braces" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wunused-lambda-capture" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wunused-local-typedef" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Qunused-arguments" CMAKE_CXX_FLAGS)
if(${USE_COLORIZE_OUTPUT})
endif()

View File

@ -15,7 +15,6 @@ default_compiler_flags = [
"-Wno-unused-function",
"-Wno-unused-parameter",
"-Wno-error=strict-aliasing",
"-Wno-unused-local-typedefs",
"-Wno-shadow-compatible-local",
"-Wno-maybe-uninitialized", # aten is built with gcc as part of HHVM
"-Wno-unknown-pragmas",