From 4a6b3c50c2c766406e91aaff5056419025321435 Mon Sep 17 00:00:00 2001 From: jatin Date: Mon, 8 Apr 2024 10:47:00 -0700 Subject: [PATCH] Silencing strcpy warnings --- src/wrapper/clap-juce-wrapper.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wrapper/clap-juce-wrapper.cpp b/src/wrapper/clap-juce-wrapper.cpp index d82a47e..429679c 100644 --- a/src/wrapper/clap-juce-wrapper.cpp +++ b/src/wrapper/clap-juce-wrapper.cpp @@ -133,7 +133,13 @@ extern JUCE_API void *attachComponentToWindowRefVST(Component *, void *parentWin } // namespace juce #endif -JUCE_BEGIN_IGNORE_WARNINGS_MSVC(4996) // allow strncpy +// Some compilers generate warnings when we use `strncpy` instead +// of `strncpy_s`. However, other compilers don't support `strncpy_s`. +// So for now, we ignore those warnings, but once all the compilers +// that we care about support `strncpy_s`, we should remove these +// warnings guards and use `strncpy_s`. +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC(4996) #if !defined(CLAP_MISBEHAVIOUR_HANDLER_LEVEL) #define CLAP_MISBEHAVIOUR_HANDLER_LEVEL "Ignore" @@ -2284,6 +2290,7 @@ class ClapJuceWrapper : public clap::helpers::Plugin< bool hasTransportInfo{false}; }; +JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_END_IGNORE_WARNINGS_MSVC const char *features[] = {CLAP_FEATURES, nullptr};