From a28597c3c9c87ee95ab4a16bc68b58887d961ecf Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Tue, 31 Jan 2023 12:53:50 +0000 Subject: [PATCH] Fix GCC 12 compiler warnings --- modules/juce_box2d/box2d/Common/b2Math.h | 2 +- modules/juce_core/containers/juce_ListenerList.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/juce_box2d/box2d/Common/b2Math.h b/modules/juce_box2d/box2d/Common/b2Math.h index e42428e6ef..f8415fe759 100644 --- a/modules/juce_box2d/box2d/Common/b2Math.h +++ b/modules/juce_box2d/box2d/Common/b2Math.h @@ -143,7 +143,7 @@ struct b2Vec2 return b2Vec2(-y, x); } - float32 x, y; + float32 x{}, y{}; }; /// A 2D column vector with 3 elements. diff --git a/modules/juce_core/containers/juce_ListenerList.h b/modules/juce_core/containers/juce_ListenerList.h index 595e37793d..5f657a0757 100644 --- a/modules/juce_core/containers/juce_ListenerList.h +++ b/modules/juce_core/containers/juce_ListenerList.h @@ -325,7 +325,10 @@ private: WrappedIterator (const ListenerList& listToIterate, WrappedIterator*& listHeadIn) : it (listToIterate), listHead (listHeadIn), next (listHead) { + // GCC 12.2 with O1 and above gets confused here + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdangling-pointer") listHead = this; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } ~WrappedIterator()