AK: Broaden GCC warning suppression in ByteBuffer.h

Turns out newer GCC versions have more of the same false positives...
This commit is contained in:
Hendiadyoin1
2025-04-14 23:44:27 +02:00
committed by Nico Weber
parent 32e4e047df
commit f8236a6bd2

View File

@@ -13,6 +13,12 @@
#include <AK/Types.h>
#include <AK/kmalloc.h>
#ifdef AK_COMPILER_GCC
# pragma GCC diagnostic push
// GCC incorrectly claims that the size of the ByteBuffer is too small in some cases when UBSan is disabled.
# pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
namespace AK {
namespace Detail {
@@ -286,15 +292,7 @@ public:
{
// make sure we're not told to write past the end
VERIFY(offset + data_size <= size());
#ifdef AK_COMPILER_GCC
# pragma GCC diagnostic push
// GCC incorrectly claims that the size of the ByteBuffer is too small in some cases on AArch64/RISC-V when UBSan is disabled.
# pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
__builtin_memmove(this->data() + offset, data, data_size);
#ifdef AK_COMPILER_GCC
# pragma GCC diagnostic pop
#endif
}
void zero_fill()
@@ -389,4 +387,8 @@ struct Traits<ByteBuffer> : public DefaultTraits<ByteBuffer> {
}
};
#ifdef AK_COMPILER_GCC
# pragma GCC diagnostic pop
#endif
}