clang-tidy: Enable cppcoreguidelines-pro-bounds
Modified code to address issues flagged by
cppcoreguidelines-pro-bounds-array-to-pointer-decay check.
Tested: Build and unit tests passed successfully.
Change-Id: I68f418d0dad440df685c103709589f6e78d141fb
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/test/debug_inif_test.cpp b/test/debug_inif_test.cpp
index fb632dc..08cb2a7 100644
--- a/test/debug_inif_test.cpp
+++ b/test/debug_inif_test.cpp
@@ -5,6 +5,7 @@
#include <exception>
#include <filesystem>
#include <set>
+#include <span>
#include <string>
#include <gtest/gtest.h>
@@ -19,7 +20,9 @@
void SetUp()
{
char tmpdir[] = "/tmp/dump.XXXXXX";
- auto dirPtr = mkdtemp(tmpdir);
+ std::span<char> tmpdirSpan(reinterpret_cast<char*>(tmpdir),
+ sizeof(tmpdir));
+ auto dirPtr = mkdtemp(tmpdirSpan.data());
if (dirPtr == NULL)
{
throw std::bad_alloc();