Warnings in latest VST3 changes

/Users/rrabien/actions-runner/_work/Nexus/Nexus/modules/JUCE/modules/juce_audio_plugin_client/VST3/juce_VST3ModuleInfo.h:102:31: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
  102 |             for (int i = 0; i < oldIds.size(); ++i)
      |                             ~ ^ ~~~~~~~~~~~~~
/Users/rrabien/actions-runner/_work/Nexus/Nexus/modules/JUCE/modules/juce_audio_plugin_client/VST3/juce_VST3ModuleInfo.h:116:23: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
  116 |                 if (i < oldIds.size() - 1)
      |                     ~ ^ ~~~~~~~~~~~~~~~~~
2 errors generated.

Can these be silenced?

Also, which DAWs are you using to test this VST2 → VST3 migration stuff? I know it’s not supported in all DAWs. Any plans to add it for the juce hosting side?

Please do not silence such warnings in the framework, but in your own projects.
To avoid them you can loop with unsigned, because size() does not return an int. Different types.

The only DAW that I know implements it right now is Cubase, that’s what we tested with, although I assume at least Nuendo must too. Reaper seems to already have its own mechanism. I think it must just assume the parameters are declared in the same order. I’m not sure about other DAWs. We haven’t yet considered adding this to the host, but at some point I think that would be sensible.

The code creating these warnings is in JUCE. How are we supposed to silence them? Why would the JUCE team not fix their code? What are you talking about?

I ended by using juce_recommended_warning_flags to avoid to get warnings never fixed.

Those will also be applied to your code. I think Peter must have misunderstood something as surely nobody would suggest leaving warnings in the framework for others to find workarounds for.

This should be fixed on develop now, thanks for reporting.

Relax Michael.

That was an appropriate warning about mixing signed and unsigned types.

Roland was asking for silencing those warnings.

Silencing more warnings for sloppy Juce code is not a good approach, in my humble opinion.

It has now been appropriately fixed with a size_t already.

That’s exactly what Roland asked for. With “silencing” he didn’t mean that they should suppress the warning, but fix it.

He used similar language before and it was understood correctly.

Sure,

There are quite some spots in Juce where compiler warnings are silenced.

This looked like a request for another one.

Not everyone uses your native language like you do.

JUCE suppresses warnings for 3rd party libraries (like HarfBuzz) where they have little to no control.

I’m not a native speaker myself, but I’ve seen enough requests like this (not only in JUCE but also in other frameworks/libraries) that I intuitively understand these requests now.

This does not appear to be working. If I diff the changes in my moduleinfo.json from the latest released version of Nexus to the version generated by the latest tip of juce, they are not the same.

The name and version are missing, not sure if that is important.

The Compatibility Old IDs are different. The tip of JUCE generates a shorter id. They are 16 bytes, so there should be 32 hex characters, but I’m only seeing 28.

You are using std::setw (2) but you are only calling it once. From the std::setw docs:

Some operations reset the width to zero (see below), so std::setw may need to be repeatedly called to set the width for multiple operations.

I think the loop should look like this:

            for (size_t i = 0; i < oldIds.size(); ++i)
            {
                str << "\""
                    << std::hex
                    << std::setfill ('0')
                    << std::uppercase;

                for (auto byte : oldIds[i])
                    str << std::setw (2) << (int) byte;

                str.clear();
                str << "\"";

                if (i < oldIds.size() - 1)
                    str << ", ";
            }

Thanks, that sounds like a serious issue I’ll take a look immediately.

Just tested with Repear and it’s working again. Will test with Cubase once they refresh my NFR.

1 Like

Seems you got there before me but for the record these two commits aim to fix the issues you raised.

I also suppressed a couple more warnings

1 Like