Commit 6b9c227
committed
integer: suppress false-positive GCC 14.3.1 stringop-overflow/array-bounds
arm-none-eabi-gcc 14.3.1 (arm-gnu-toolchain-14.3.rel1) misdiagnoses the
std::copy byte-transfer in integer_storage::integer_storage(T, endian)
and to_integral() as overflowing when SIZE == 1, claiming a memmove of
"between 2 and 2147483647 bytes" into a 1-byte destination. The copy
count is always a compile-time constant bounded by min(sizeof(T), SIZE),
so this is a compiler false positive, not a real overflow.
Wrap the transfer logic in both functions with a GCC-only
diagnostic push/pop that ignores -Wstringop-overflow and
-Warray-bounds.
Signed-off-by: Benedek Kupper <kupper.benedek@gmail.com>1 parent 58bda56 commit 6b9c227
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| |||
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
129 | 142 | | |
130 | 143 | | |
131 | 144 | | |
| |||
148 | 161 | | |
149 | 162 | | |
150 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
151 | 167 | | |
152 | 168 | | |
153 | 169 | | |
| |||
0 commit comments