forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boost-1.47.0-fix-strict-overflow.patch
124 lines (111 loc) · 4.08 KB
/
boost-1.47.0-fix-strict-overflow.patch
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
diff --git a/boost/regex/v4/match_results.hpp b/boost/regex/v4/match_results.hpp
index ca9898f..2eb4782 100644
--- a/boost/regex/v4/match_results.hpp
+++ b/boost/regex/v4/match_results.hpp
@@ -212,6 +212,9 @@ public:
{
if(m_is_singular && m_subs.empty())
raise_logic_error();
+ if (sub > (INT_MAX-2))
+ return m_null;
+
sub += 2;
if(sub < (int)m_subs.size() && (sub >= 0))
{
diff --git a/boost/date_time/int_adapter.hpp b/boost/date_time/int_adapter.hpp
index fc98fc1..fd089ad 100644
--- a/boost/date_time/int_adapter.hpp
+++ b/boost/date_time/int_adapter.hpp
@@ -20,7 +20,10 @@
namespace boost {
namespace date_time {
-
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
//! Adapter to create integer types with +-infinity, and not a value
/*! This class is used internally in counted date/time representations.
@@ -504,6 +505,8 @@ private:
} } //namespace date_time
-
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
#endif
diff --git a/boost/spirit/home/classic/core/primitives/impl/numerics.ipp b/boost/spirit/home/classic/core/primitives/impl/numerics.ipp
index 19586f1..0b10caa 100644
--- a/boost/spirit/home/classic/core/primitives/impl/numerics.ipp
+++ b/boost/spirit/home/classic/core/primitives/impl/numerics.ipp
@@ -171,7 +171,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
return false;
n *= Radix;
- if (n > max - digit)
+ if (n - max + digit > 0)
return false;
n += digit;
diff --git a/boost/spirit/home/classic/core/safe_bool.hpp b/boost/spirit/home/classic/core/safe_bool.hpp
index 73b6e7b..47926fa 100644
--- a/boost/spirit/home/classic/core/safe_bool.hpp
+++ b/boost/spirit/home/classic/core/safe_bool.hpp
@@ -49,11 +49,20 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
&impl_t::stub : 0;
}
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
+
operator bool_type()
{
return static_cast<DerivedT*>(this)->operator_bool() ?
&impl_t::stub : 0;
}
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
+
};
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
diff --git a/boost/circular_buffer/details.hpp b/boost/circular_buffer/details.hpp
index da25ff0..b894c2c 100644
--- a/boost/circular_buffer/details.hpp
+++ b/boost/circular_buffer/details.hpp
@@ -317,6 +317,10 @@ struct iterator :
//! Iterator addition.
iterator& operator += (difference_type n) {
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
BOOST_CB_ASSERT(is_valid(m_buff)); // check for uninitialized or invalidated iterator
if (n > 0) {
BOOST_CB_ASSERT(m_buff->end() - *this >= n); // check for too large n
@@ -327,6 +331,9 @@ struct iterator :
*this -= -n;
}
return *this;
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
}
//! Iterator addition.
@@ -334,6 +341,10 @@ struct iterator :
//! Iterator subtraction.
iterator& operator -= (difference_type n) {
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
BOOST_CB_ASSERT(is_valid(m_buff)); // check for uninitialized or invalidated iterator
if (n > 0) {
BOOST_CB_ASSERT(*this - m_buff->begin() >= n); // check for too large n
@@ -342,6 +353,9 @@ struct iterator :
*this += -n;
}
return *this;
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
}
//! Iterator subtraction.