Skip to content

Commit d724a91

Browse files
mehtaniravpytorchmergebot
authored andcommitted
Adding Wunused-local-typedef build flag (pytorch#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: [pytorch#79978](pytorch#79978) As part of this change, we want to catch this error in the PR Checks itself. Pull Request resolved: pytorch#86154 Approved by: https://github.com/huydhn, https://github.com/seemethere, https://github.com/osalpekar
1 parent 8da704c commit d724a91

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ if(NOT MSVC)
832832
append_cxx_flag_if_supported("-Wno-type-limits" CMAKE_CXX_FLAGS)
833833
append_cxx_flag_if_supported("-Wno-array-bounds" CMAKE_CXX_FLAGS)
834834
append_cxx_flag_if_supported("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
835+
append_cxx_flag_if_supported("-Wunused-local-typedefs" CMAKE_CXX_FLAGS)
835836
append_cxx_flag_if_supported("-Wno-unused-parameter" CMAKE_CXX_FLAGS)
836837
append_cxx_flag_if_supported("-Wno-unused-function" CMAKE_CXX_FLAGS)
837838
append_cxx_flag_if_supported("-Wno-unused-result" CMAKE_CXX_FLAGS)
@@ -895,6 +896,7 @@ if(NOT MSVC)
895896
append_cxx_flag_if_supported("-Wno-constexpr-not-const" CMAKE_CXX_FLAGS)
896897
append_cxx_flag_if_supported("-Wno-missing-braces" CMAKE_CXX_FLAGS)
897898
append_cxx_flag_if_supported("-Wunused-lambda-capture" CMAKE_CXX_FLAGS)
899+
append_cxx_flag_if_supported("-Wunused-local-typedef" CMAKE_CXX_FLAGS)
898900
append_cxx_flag_if_supported("-Qunused-arguments" CMAKE_CXX_FLAGS)
899901
if(${USE_COLORIZE_OUTPUT})
900902
endif()

defs.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ default_compiler_flags = [
1515
"-Wno-unused-function",
1616
"-Wno-unused-parameter",
1717
"-Wno-error=strict-aliasing",
18-
"-Wno-unused-local-typedefs",
1918
"-Wno-shadow-compatible-local",
2019
"-Wno-maybe-uninitialized", # aten is built with gcc as part of HHVM
2120
"-Wno-unknown-pragmas",

0 commit comments

Comments
 (0)