From b7741a0bdd9b88b31a62ce7be8b7b132ec451c02 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 8 Aug 2020 16:33:35 -0400 Subject: [PATCH] Supress Wstringop-truncation warnings --- indra/llcommon/llsdutil.cpp | 4 ++++ indra/llmessage/llnamevalue.cpp | 4 ++++ indra/llvfs/tests/lldir_test.cpp | 4 +--- indra/newview/llurl.cpp | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index b70529ced7d..4090a838877 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -47,6 +47,10 @@ #include <set> #include <boost/range.hpp> +#if LL_GNUC +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif + // U32 LLSD ll_sd_from_U32(const U32 val) { diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index c51883ee3d8..f7c0517b4c4 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -35,6 +35,10 @@ #include "llstring.h" #include "llstringtable.h" +#if LL_GNUC +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif + // Anonymous enumeration to provide constants in this file. // *NOTE: These values may be used in sscanf statements below as their // value-1, so search for '2047' if you cange NV_BUFFER_LEN or '63' if diff --git a/indra/llvfs/tests/lldir_test.cpp b/indra/llvfs/tests/lldir_test.cpp index 3cff622a4ba..6cc4f741145 100644 --- a/indra/llvfs/tests/lldir_test.cpp +++ b/indra/llvfs/tests/lldir_test.cpp @@ -435,9 +435,7 @@ namespace tut for (counter=0, foundUnused=false; !foundUnused; counter++ ) { - char counterStr[3]; - sprintf(counterStr, "%02d", counter); - uniqueDir = dirbase + counterStr; + uniqueDir = dirbase + std::to_string(counter); foundUnused = ! ( LLFile::isdir(uniqueDir) || LLFile::isfile(uniqueDir) ); } ensure("test directory '" + uniqueDir + "' creation failed", !LLFile::mkdir(uniqueDir)); diff --git a/indra/newview/llurl.cpp b/indra/newview/llurl.cpp index 01a81c5f83e..64fc0815150 100644 --- a/indra/newview/llurl.cpp +++ b/indra/newview/llurl.cpp @@ -28,6 +28,10 @@ #include "llurl.h" #include "llerror.h" +#if LL_GNUC +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif + LLURL::LLURL() { init(""); -- GitLab