Fix initialization in test (#1140)

* Suppress unsafe-buffer-usage
This commit is contained in:
d-winsor authored and GitHub committed 2024-02-26 13:17:12 -08:00
1 parent caae4dd0f8
commit 1b4d42ca2e
4 files changed
+31 -11

No files matched your search

+10
View File
@@ -63,6 +63,12 @@
#pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
namespace gsl
{
@@ -846,4 +852,8 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
#pragma GCC diagnostic pop
#endif // __GNUC__ > 6
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
#pragma clang diagnostic pop
#endif
#endif // GSL_SPAN_H
+10
View File
@@ -40,6 +40,12 @@
#endif // _MSC_VER
// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
#if defined(__cplusplus) && (__cplusplus >= 201703L)
#define GSL_NODISCARD [[nodiscard]]
#else
@@ -154,4 +160,8 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
#endif // _MSC_VER
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
#pragma clang diagnostic pop
#endif
#endif // GSL_UTIL_H