Skip to content

Commit 4153a32

Browse files
HTRamseybkueng
authored andcommitted
Add Version Check to GCC Warning
1 parent 8438f2b commit 4153a32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ulog_cpp/messages.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,14 @@ class Value {
434434
throw AccessException("Unexpected data type size");
435435
}
436436
// GCC 14.2 raises an error here when building with -fsanitize=address
437-
#ifdef __GNUC__
437+
#if defined(__GNUC__) && (__GNUC__ >= 14)
438438
#pragma GCC diagnostic push
439439
#pragma GCC diagnostic ignored "-Warray-bounds"
440440
#pragma GCC diagnostic ignored "-Wstringop-overflow"
441441
#endif
442442
std::copy(backing_start + total_offset, backing_start + total_offset + sizeof(v),
443443
reinterpret_cast<uint8_t*>(&v));
444-
#ifdef __GNUC__
444+
#if defined(__GNUC__) && (__GNUC__ >= 14)
445445
#pragma GCC diagnostic pop
446446
#endif
447447
return v;

0 commit comments

Comments
 (0)