mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
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:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user