1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

GCC: Fix some compiler warnings in GCC 11

This commit is contained in:
Tom Poole 2022-04-01 16:39:37 +01:00
parent f69fe7be0f
commit e984395b1d
9 changed files with 13 additions and 15 deletions

View file

@ -1567,7 +1567,7 @@ public:
const int num = random.nextInt (range) + 1;
HeapBlock<ValueType> buffer1 (num + 16), buffer2 (num + 16);
HeapBlock<int> buffer3 (num + 16);
HeapBlock<int> buffer3 (num + 16, true);
#if JUCE_ARM
ValueType* const data1 = buffer1;

View file

@ -55,11 +55,6 @@ void MidiRPNDetector::reset() noexcept
}
//==============================================================================
MidiRPNDetector::ChannelState::ChannelState() noexcept
: parameterMSB (0xff), parameterLSB (0xff), valueMSB (0xff), valueLSB (0xff), isNRPN (false)
{
}
bool MidiRPNDetector::ChannelState::handleController (int channel,
int controllerNumber,
int value,

View file

@ -95,14 +95,13 @@ private:
//==============================================================================
struct ChannelState
{
ChannelState() noexcept;
bool handleController (int channel, int controllerNumber,
int value, MidiRPNMessage&) noexcept;
void resetValue() noexcept;
bool sendIfReady (int channel, MidiRPNMessage&) noexcept;
uint8 parameterMSB, parameterLSB, valueMSB, valueLSB;
bool isNRPN;
uint8 parameterMSB = 0xff, parameterLSB = 0xff, valueMSB = 0xff, valueLSB = 0xff;
bool isNRPN = false;
};
//==============================================================================

View file

@ -42,7 +42,8 @@ namespace OggVorbisNamespace
"-Wredundant-decls",
"-Wmisleading-indentation",
"-Wmissing-prototypes",
"-Wcast-align")
"-Wcast-align",
"-Wmaybe-uninitialized")
JUCE_BEGIN_NO_SANITIZE ("undefined")
#include "oggvorbis/vorbisenc.h"

View file

@ -59,7 +59,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-copy-dtor",
"-Wmissing-prototypes",
"-Wtype-limits",
"-Wcpp",
"-W#warnings")
"-W#warnings",
"-Wmaybe-uninitialized")
#undef DEVELOPMENT
#define DEVELOPMENT 0 // This avoids a Clang warning in Steinberg code about unused values

View file

@ -35,7 +35,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion",
"-Wswitch-enum",
"-Wswitch-default",
"-Wunused-but-set-variable",
"-Wzero-as-null-pointer-constant")
"-Wzero-as-null-pointer-constant",
"-Wmaybe-uninitialized")
#include <cstdarg>

View file

@ -52,7 +52,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion",
"-Wshadow-field",
"-Wzero-as-null-pointer-constant",
"-Wsign-conversion",
"-Wdeprecated")
"-Wdeprecated",
"-Wmaybe-uninitialized")
#include <climits>
#include <cfloat>

View file

@ -104,7 +104,7 @@ struct CppTokeniserFunctions
static int parseIdentifier (Iterator& source) noexcept
{
int tokenLength = 0;
String::CharPointerType::CharType possibleIdentifier[100];
String::CharPointerType::CharType possibleIdentifier[100] = {};
String::CharPointerType possible (possibleIdentifier);
while (isIdentifierBody (source.peekNextChar()))

View file

@ -71,7 +71,7 @@ struct LuaTokeniserFunctions
static int parseIdentifier (Iterator& source) noexcept
{
int tokenLength = 0;
String::CharPointerType::CharType possibleIdentifier[100];
String::CharPointerType::CharType possibleIdentifier[100] = {};
String::CharPointerType possible (possibleIdentifier);
while (CppTokeniserFunctions::isIdentifierBody (source.peekNextChar()))