turn on -Werror=unused-but-set-variable

Summary:
Also fix the one violation.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79305

Approved by: https://github.com/malfet
This commit is contained in:
Michael Andreas Dagitses
2022-06-13 06:21:23 -07:00
committed by PyTorch MergeBot
parent c77dc60143
commit 52a5266aab
4 changed files with 2 additions and 4 deletions

View File

@ -57,6 +57,7 @@ build:cpu-only --@rules_cuda//cuda:enable_cuda=False
# * it allows for selective overrides on individual targets since the
# macro-level opts will come earlier than target level overrides
build --per_file_copt='^//.*\.(cpp|cc)$'@-Werror=type-limits
build --per_file_copt='^//.*\.(cpp|cc)$'@-Werror=unused-but-set-variable
build --per_file_copt='^//.*\.(cpp|cc)$'@-Werror=unused-function
build --per_file_copt='^//.*\.(cpp|cc)$'@-Werror=unused-variable