New Warnings with CLion and MSVC

Using the very latest tip of the develop branch, seems like a lot of new warnings are generated:

When building a Projucer-template VST3 plugin in CLion on Mac, I get a bunch of:

warning: pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop' [-Wunknown-pragmas] #pragma GCC diagnostic default "-Wpragma-pack"

In MSVC (Visual Studio 2019), when I switch the C++ version of the plugin template to C++17 or “Latest”, I get a lot of:

warning C5055: operator '+': deprecated between enumerations and floating-point types (compiling source file ..\..\JuceLibraryCode\include_juce_audio_plugin_client_utils.cpp)

Thanks!
Eyal

This is new for MSVC 2019 16.2 (released today!). We’ve already fixed similar warnings in our own code, now just waiting for ROLI to fix JUCE :slight_smile:

1 Like

Thank you for this fix, @t0m!
Seems to be warning free on both CLion and the latest VS2019. :slight_smile:

1 Like

These turn up on XCode as well…

Can you please clean up some mess in the Steinberg SDK?

In file included from ../../../../JUCE/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/conststringtable.cpp:17:
../../../../JUCE/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/conststringtable.h:36:2: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
        const char16 getString (const char8 str) const;
        ^~~~~~
In file included from ../../../../JUCE/modules/juce_audio_plugin_client/VST3/../../juce_audio_processors/format_types/juce_VST3Headers.h:125:
../../../../JUCE/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/conststringtable.cpp:47:1: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
const char16 ConstStringTable::getString (const char8 str) const
^~~~~~
In file included from ../../../../JUCE/modules/juce_audio_plugin_client/VST3/../../juce_audio_processors/format_types/juce_VST3Headers.h:140:
../../../../JUCE/modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.cpp:50:13: warning: missing field 'title' initializer [-Wmissing-field-initializers]
        info = { 0 };
                   ^
../../../../JUCE/modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.cpp:65:13: warning: missing field 'title' initializer [-Wmissing-field-initializers]
        info = { 0 };
                   ^
../../../../JUCE/modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.cpp:416:25: warning: missing field 'title' initializer [-Wmissing-field-initializers]
        ParameterInfo info = {0};
                               ^
In file included from ../../../../JUCE/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp:46:
../../../../JUCE/modules/juce_audio_plugin_client/VST3/../../juce_audio_processors/format_types/juce_VST3Common.h:539:43: warning: missing field 'sampleOffset' initializer [-Wmissing-field-initializers]
            Steinberg::Vst::Event e = { 0 };
                                          ^

And Apple as well (spread the love equally):

In file included from ../../../../JUCE/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUCarbonViewBase.cpp:47:
../../../../JUCE/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUCarbonViewBase.h:81:2: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
        const AudioUnit                         GetEditAudioUnit () const { return mEditAudioUnit; }
        ^~~~~~

Many thanks!

Awesome, that was quick!
Finally back to the one warning, that I won’t solve: update to recommended settings (not listening to Apple’s recommendation :wink: )

Thanks a bunch @t0m!