summaryrefslogtreecommitdiff
path: root/0001-gcc-false-positive.patch
blob: 723f4ed1217800f52fe50e24877b8399c206e13c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 9423894b789e9a7af10cf9ac2a0b114bd360c7bb Mon Sep 17 00:00:00 2001
From: binsz <274620705z@gmail.com>
Date: Wed, 31 Jan 2024 09:20:19 +0800
Subject: [PATCH] gcc false positive

---
 .../optimizer/selectors_actions/selector_action_transformer.cc  | 2 ++
 onnxruntime/core/providers/cpu/tensor/scatter.cc                | 2 ++
 onnxruntime/test/framework/sparse_kernels_test.cc               | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc b/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
index e182b6c..29fb768 100644
--- a/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
+++ b/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
@@ -1,6 +1,8 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+
 #include "core/optimizer/selectors_actions/selector_action_transformer.h"
 
 #include <cassert>
diff --git a/onnxruntime/core/providers/cpu/tensor/scatter.cc b/onnxruntime/core/providers/cpu/tensor/scatter.cc
index 8844b7e..7ca4edd 100644
--- a/onnxruntime/core/providers/cpu/tensor/scatter.cc
+++ b/onnxruntime/core/providers/cpu/tensor/scatter.cc
@@ -16,6 +16,8 @@
 #include "orttraining/training_ops/cpu/tensor/gather_elements_grad_impl.h"
 #endif
 
+#pragma GCC diagnostic ignored "-Warray-bounds"
+
 namespace onnxruntime {
 
 namespace op_kernel_type_control {
diff --git a/onnxruntime/test/framework/sparse_kernels_test.cc b/onnxruntime/test/framework/sparse_kernels_test.cc
index 80f23b0..dbdab02 100644
--- a/onnxruntime/test/framework/sparse_kernels_test.cc
+++ b/onnxruntime/test/framework/sparse_kernels_test.cc
@@ -27,6 +27,8 @@
 #include "core/util/math_cpuonly.h"
 #include <Eigen/SparseCore>
 
+// #pragma GCC diagnostic ignored "-Wdangling-reference" // TODO: fix this
+
 using namespace ONNX_NAMESPACE;
 using namespace onnxruntime::common;
 
-- 
2.41.0