mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpiutil] Suppress protobuf warning false positives on GCC 13 (#5907)
This commit is contained in:
@@ -681,7 +681,14 @@ class PROTOBUF_EXPORT EpsCopyOutputStream {
|
||||
if (PROTOBUF_PREDICT_FALSE(end_ - ptr < static_cast<int>(size))) {
|
||||
return WriteRawFallback(data, size, ptr);
|
||||
}
|
||||
#if __GNUC__ >= 13
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow="
|
||||
#endif // __GNUC__ >= 13
|
||||
std::memcpy(ptr, data, size);
|
||||
#if __GNUC__ >= 13
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // __GNUC__ >= 13
|
||||
return ptr + size;
|
||||
}
|
||||
// Writes the buffer specified by data, size to the stream. Possibly by
|
||||
|
||||
@@ -96,9 +96,16 @@ void UnknownFieldSet::MergeFromAndDestroy(UnknownFieldSet* other) {
|
||||
if (fields_.empty()) {
|
||||
fields_ = std::move(other->fields_);
|
||||
} else {
|
||||
#if __GNUC__ >= 13
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow="
|
||||
#endif // __GNUC__ >= 13
|
||||
fields_.insert(fields_.end(),
|
||||
std::make_move_iterator(other->fields_.begin()),
|
||||
std::make_move_iterator(other->fields_.end()));
|
||||
#if __GNUC__ >= 13
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // __GNUC__ >= 13
|
||||
}
|
||||
other->fields_.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user