ff_meters icon indicating copy to clipboard operation
ff_meters copied to clipboard

Can't get rid of these warning messages (with the latest version of ff_meters)

Open mediawizrd opened this issue 5 years ago • 6 comments

I get the following errors with the latest version of ff_meters. I have tried a few things, but can't get them to go away.

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\include\numeric(35,26): warning C4244: '=': conversion from 'double' to '_Ty', possible loss of data 1> with 1> [ 1> _Ty=float 1> ] (compiling source file ....\Source\MonitorCls.cpp) 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\include\numeric(44): message : see reference to function template instantiation '_Ty std::accumulate<_InIt,_Ty,std::plus>(const _InIt,const _InIt,_Ty,_Fn)' being compiled 1> with 1> [ 1> _Ty=float, 1> _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>, 1> _Fn=std::plus 1> ] (compiling source file ....\Source\MonitorCls.cpp) 1>D:\Dev\X-platform\Juce-Modules\ff_meters\LevelMeter\LevelMeterSource.h(102): message : see reference to function template instantiation '_Ty std::accumulate<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>,float>(const _InIt,const _InIt,_Ty)' being compiled 1> with 1> [ 1> _Ty=float, 1> _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>> 1> ] (compiling source file ....\Source\MonitorCls.cpp) 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\include\numeric(35,26): warning C4244: '=': conversion from 'double' to '_Ty', possible loss of data 1> with 1> [ 1> _Ty=float 1> ] (compiling source file ....\Source\MainOutputCls.cpp) 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\include\numeric(44): message : see reference to function template instantiation '_Ty std::accumulate<_InIt,_Ty,std::plus>(const _InIt,const _InIt,_Ty,_Fn)' being compiled 1> with 1> [ 1> _Ty=float, 1> _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>, 1> _Fn=std::plus 1> ] (compiling source file ....\Source\MainOutputCls.cpp) 1>D:\Dev\X-platform\Juce-Modules\ff_meters\LevelMeter\LevelMeterSource.h(102): message : see reference to function template instantiation '_Ty std::accumulate<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>,float>(const _InIt,const _InIt,_Ty)' being compiled 1> with 1> [ 1> _Ty=float, 1> _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>> 1> ] (compiling source file ....\Source\MainOutputCls.cpp)

NOTE: There are also several places where "unreachable code" is defined, and those cause warnings as well, but I just commented out the code that caused it.

mediawizrd avatar Jul 21 '20 00:07 mediawizrd

I have the same warning messages on Microsoft Visual C++ 2019 with JUCE 6.0.7 and the latest version of the ff_meters module.

ff_meters\LookAndFeel\LevelMeterLookAndFeelMethods.h(245): warning C4702: unreachable code ff_meters\LookAndFeel\LevelMeterLookAndFeelMethods.h(102): warning C4702: unreachable code ff_meters\LookAndFeel\LevelMeterLookAndFeelMethods.h(191): warning C4702: unreachable code

Did you find a fix for this?

r00tk1ll avatar Mar 15 '21 06:03 r00tk1ll

I can get the app to build / work, but I was never able to get rid of the warning messages.


From: r00tk1ll @.> Sent: Sunday, March 14, 2021 11:54:04 PM To: ffAudio/ff_meters @.> Cc: mediawizrd @.>; Author @.> Subject: Re: [ffAudio/ff_meters] Can't get rid of these warning messages (with the latest version of ff_meters) (#16)

I have the same warning messages on Microsoft Visual C++ 2019 with JUCE 6.0.7 and the latest version of the ff_meters module.

Did you find a fix for this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ffAudio/ff_meters/issues/16#issuecomment-799164448, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQAPFEU3ZLXLUBQTW5ZTSDDTDWVIZANCNFSM4PC52F4A.

mediawizrd avatar Mar 15 '21 08:03 mediawizrd

Ill keep looking for a way, its just annoying really

r00tk1ll avatar Mar 16 '21 09:03 r00tk1ll

the same for me, struggling on how to suppress these warnings

NickolayGerasimenko avatar Sep 17 '21 17:09 NickolayGerasimenko

It should not have been occurred if the config option was set to false. But since it has been a while everybody had the chance to fix the automatic channel allocation. I removed that option including the warning. If you don't see any meters, you need to call meterSource.resize(numChannels) in your prepareToPlay or anywhere outside the audio thread.

ffAudio avatar Sep 17 '21 19:09 ffAudio

@ffAudio Sorry but I still see this warnings:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\numeric(35,26): warning C4244: '=': conversion from 'double' to '_Ty', possible loss of data 1> with 1> [ 1> _Ty=float 1> ] (compiling source file ....\JuceLibraryCode\include_ff_meters.cpp)

  with

1> 1> _Ty=float, 1> _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>, 1> _Fn=std::plus [1> ] (compiling source file ....\JuceLibraryCode\include_ff_meters.cpp) 1>D:\Projects\source_elements\sc4\ext\ff_meters\LevelMeter\LevelMeterSource.h(102):`

Looks like it's type cast issue: if (rmsHistory.size() > 0) return std::sqrt(std::accumulate (rmsHistory.begin(), rmsHistory.end(), 0.0f)

rmsHistory - it's double but 0.0f it's float

Second this error also exists:

return juce::Rectangle (); }

ff_meters\LookAndFeel\LevelMeterLookAndFeelMethods.h(245): warning C4702: unreachable code

NickolayGerasimenko avatar Sep 20 '21 13:09 NickolayGerasimenko