Skip to content

Commit f4fa80e

Browse files
committed
suppress warning 2
1 parent c5ca9ef commit f4fa80e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/r4/matrix.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,12 @@ class matrix :
10831083
for (size_t dc = col; dc != ret[dr].size(); ++dc) {
10841084
// GCC 12 false-positively complains, when using -O3 optimization level:
10851085
// error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' offset [16, 19] is out of the bounds [0, 16] of object 'ret' with type 'r4::matrix<int, 2, 2>' [-Werror=array-bounds]
1086+
// error: 'void* __builtin_memcpy(void*, const void*, unsigned int)' writing between 4 and 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
10861087
// so we disable the warnings
10871088
#if CFG_COMPILER == CFG_COMPILER_GCC && CFG_COMPILER_VERSION_MAJOR == 12
10881089
# pragma GCC diagnostic push
10891090
# pragma GCC diagnostic ignored "-Warray-bounds"
1091+
# pragma GCC diagnostic ignored "-Wstringop-overflow"
10901092
#endif
10911093
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-constant-array-index)
10921094
ret[dr][dc] = this->row(dr)[dc + 1];

0 commit comments

Comments
 (0)