Skip to content

Commit 17540c5

Browse files
Nolan O'Brienfacebook-github-bot
Nolan O'Brien
authored andcommitted
[warnings][Caffe2] Suppress warnings in non-c10 headers (#71370)
Summary: Pull Request resolved: #71370 Round out suppressing warnings in `caffe2` headers Test Plan: CI check Reviewed By: r-barnes Differential Revision: D33613084 fbshipit-source-id: 9306d480bd796aeae4d887ad26b6ddc2c571c9e4
1 parent cf47338 commit 17540c5

File tree

7 files changed

+52
-0
lines changed

7 files changed

+52
-0
lines changed

aten/src/ATen/TensorIterator.h

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
#include <array>
1414
#include <bitset>
1515

16+
C10_CLANG_DIAGNOSTIC_PUSH()
17+
#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
18+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wshorten-64-to-32")
19+
#endif
20+
#if C10_CLANG_HAS_WARNING("-Wdeprecated-copy-dtor")
21+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wdeprecated-copy-dtor")
22+
#endif
23+
1624
namespace at {
1725
class Tensor;
1826
class OptionalTensorRef;
@@ -795,3 +803,5 @@ struct TORCH_API SplitUntil32Bit {
795803
};
796804

797805
} // namespace at
806+
807+
C10_CLANG_DIAGNOSTIC_POP()

aten/src/ATen/TensorMeta.h

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#include <c10/core/TensorOptions.h>
55
#include <ATen/core/Dimname.h>
66

7+
C10_CLANG_DIAGNOSTIC_PUSH()
8+
#if C10_CLANG_HAS_WARNING("-Wdeprecated-copy-dtor")
9+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wdeprecated-copy-dtor")
10+
#endif
11+
712
namespace at {
813

914
class Tensor;
@@ -74,3 +79,5 @@ struct TORCH_API MetaBase {
7479
} // namespace impl
7580

7681
} // namespace at
82+
83+
C10_CLANG_DIAGNOSTIC_POP()

caffe2/core/operator.h

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
#include <ATen/core/ivalue.h>
3939
#endif
4040

41+
C10_CLANG_DIAGNOSTIC_PUSH()
42+
#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
43+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wshorten-64-to-32")
44+
#endif
45+
4146
C10_DECLARE_bool(caffe2_operator_throw_if_fp_exceptions);
4247
C10_DECLARE_bool(caffe2_operator_throw_if_fp_overflow_exceptions);
4348
#ifdef __GNU_LIBRARY__
@@ -1601,4 +1606,6 @@ inline unique_ptr<ExternalTensorFunctionsBase> CreateExternalTensorFunctions(
16011606

16021607
} // namespace caffe2
16031608

1609+
C10_CLANG_DIAGNOSTIC_POP()
1610+
16041611
#endif // CAFFE2_CORE_OPERATOR_H_

torch/csrc/autograd/function.h

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#include <utility>
2424
#include <vector>
2525

26+
C10_CLANG_DIAGNOSTIC_PUSH()
27+
#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
28+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wshorten-64-to-32")
29+
#endif
30+
2631
namespace torch { namespace autograd {
2732

2833
struct Edge;
@@ -618,3 +623,5 @@ edge_list collect_next_edges(Variables&&... variables) {
618623
return std::move(make.next_edges);
619624
}
620625
}} // namespace torch::autograd
626+
627+
C10_CLANG_DIAGNOSTIC_POP()

torch/csrc/jit/frontend/lexer.h

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
#include <string>
1515
#include <vector>
1616

17+
C10_CLANG_DIAGNOSTIC_PUSH()
18+
#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
19+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wshorten-64-to-32")
20+
#endif
21+
1722
namespace torch {
1823
namespace jit {
1924

@@ -541,3 +546,5 @@ struct Lexer {
541546
};
542547
} // namespace jit
543548
} // namespace torch
549+
550+
C10_CLANG_DIAGNOSTIC_POP()

torch/csrc/jit/runtime/argument_spec.h

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include <iostream>
1111
#include <vector>
1212

13+
C10_CLANG_DIAGNOSTIC_PUSH()
14+
#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
15+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wshorten-64-to-32")
16+
#endif
17+
1318
namespace torch {
1419
namespace jit {
1520

@@ -503,3 +508,5 @@ struct hash<torch::jit::CompleteArgumentSpec> {
503508
}
504509
};
505510
} // namespace std
511+
512+
C10_CLANG_DIAGNOSTIC_POP()

torch/csrc/jit/runtime/interpreter.h

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#include <torch/csrc/Export.h>
1010
#include <torch/csrc/jit/frontend/source_range.h>
1111

12+
C10_CLANG_DIAGNOSTIC_PUSH()
13+
#if C10_CLANG_HAS_WARNING("-Wdeprecated-copy-dtor")
14+
C10_CLANG_DIAGNOSTIC_IGNORE("-Wdeprecated-copy-dtor")
15+
#endif
16+
1217
C10_DECLARE_bool(torch_jit_disable_warning_prints);
1318
C10_DECLARE_bool(torch_jit_enable_rethrow_caught_exception);
1419

@@ -159,3 +164,5 @@ TORCH_API std::vector<std::string> currentModuleHierarchy();
159164

160165
} // namespace jit
161166
} // namespace torch
167+
168+
C10_CLANG_DIAGNOSTIC_POP()

0 commit comments

Comments
 (0)