Skip to content

Commit 916a849

Browse files
committed
ignore some gcc warnings when building with -fsanitize=address
1 parent 30e885e commit 916a849

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ulog_cpp/messages.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,17 @@ class Value {
433433
backing_end - backing_start < static_cast<int64_t>(sizeof(v)) + total_offset) {
434434
throw AccessException("Unexpected data type size");
435435
}
436+
// GCC 14.2 raises an error here when building with -fsanitize=address
437+
#ifdef __GNUC__
438+
#pragma GCC diagnostic push
439+
#pragma GCC diagnostic ignored "-Warray-bounds"
440+
#pragma GCC diagnostic ignored "-Wstringop-overflow"
441+
#endif
436442
std::copy(backing_start + total_offset, backing_start + total_offset + sizeof(v),
437443
reinterpret_cast<uint8_t*>(&v));
444+
#ifdef __GNUC__
445+
#pragma GCC diagnostic pop
446+
#endif
438447
return v;
439448
}
440449

ulog_cpp/simple_writer.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66

77
#include <cstdio>
88
#include <memory>
9+
// GCC 14.2 raises an error in <regex> when building with -fsanitize=address
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
13+
#endif
914
#include <regex>
15+
#ifdef __GNUC__
16+
#pragma GCC diagnostic pop
17+
#endif
1018
#include <unordered_map>
1119
#include <vector>
1220

0 commit comments

Comments
 (0)