Utils: Disable warning about unsafe buffer access

There is a compile time check for the size but it seem that clang is
missing that information.

Change-Id: I53ea97cd2a56f11e7ff4428a13b39d19a7d73cf1
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Marco Bubke
2023-09-06 15:55:24 +02:00
parent 1474afe8db
commit 94003d76af

View File

@@ -86,6 +86,8 @@ struct alignas(16) StringDataLayout
, reference{{string}, size, 0}
{}
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wunsafe-buffer-usage")
template<size_type Size>
constexpr StringDataLayout(const char (&string)[Size]) noexcept
{
@@ -110,6 +112,7 @@ struct alignas(16) StringDataLayout
reference = {{string}, Size - 1, 0};
}
}
QT_WARNING_POP
constexpr static size_type shortStringCapacity() noexcept
{
@@ -159,6 +162,8 @@ struct alignas(16) StringDataLayout<MaximumShortStringDataAreaSize,
, reference{{string}, size, 0}
{}
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wunsafe-buffer-usage")
template<size_type Size>
constexpr StringDataLayout(const char (&string)[Size]) noexcept
{
@@ -183,6 +188,7 @@ struct alignas(16) StringDataLayout<MaximumShortStringDataAreaSize,
reference = {{string}, Size - 1, 0};
}
}
QT_WARNING_POP
void copyHere(const StringDataLayout &other) noexcept
{