Skip to content

Commit

Permalink
Suppress GCC warnings related to the anonymous namespace used around …
Browse files Browse the repository at this point in the history
…choc::javascript

The warnings are emitted by GCC on Linux, since the commit
dbd3b4f.
  • Loading branch information
szarvas committed Jun 6, 2024
1 parent 2540c80 commit 57d1ad9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/juce_core/javascript/juce_Javascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-copy-with-dtor",
"-Wunused-but-set-variable",
"-Wdeprecated",
"-Wunused-function")
"-Wunused-function",
"-Wpedantic")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (6011 6246 6255 6262 6297 6308 6323 6340 6385 6386 28182)
#include <juce_core/javascript/choc/javascript/choc_javascript_QuickJS.h>
#include <juce_core/javascript/choc/javascript/choc_javascript.h>
Expand Down Expand Up @@ -228,6 +229,10 @@ static qjs::JSValue juceToQuickJs (var variant, qjs::JSContext* ctx)
}

//==============================================================================
// Any type that references the QuickJS types inside the anonymous namespace added by us requires
// this with GCC. Suppressing this warning is fine, since these classes are only visible and used
// in a single translation unit.
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wsubobject-linkage")
class detail::QuickJSWrapper
{
public:
Expand Down Expand Up @@ -268,6 +273,7 @@ class detail::QuickJSWrapper
choc::javascript::Context context = choc::javascript::createQuickJSContext();
std::function<int()> interruptHandler;
};
JUCE_END_IGNORE_WARNINGS_GCC_LIKE

using SetterFn = qjs::JSValue (*) (qjs::JSContext* ctx,
qjs::JSValueConst thisVal,
Expand Down Expand Up @@ -644,6 +650,7 @@ static uint32_t toUint32 (int64 value)
}

//==============================================================================
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wsubobject-linkage")
struct JSFunctionArguments
{
explicit JSFunctionArguments (qjs::JSContext* contextIn) : context (contextIn)
Expand Down Expand Up @@ -822,6 +829,7 @@ class JSObject::Impl
const detail::QuickJSWrapper* engine = nullptr;
ValuePtr valuePtr;
};
JUCE_END_IGNORE_WARNINGS_GCC_LIKE

JSObject::JSObject (const detail::QuickJSWrapper* engine)
: impl (new Impl (engine))
Expand Down

0 comments on commit 57d1ad9

Please sign in to comment.