Warning with last VS 2017 related with Waveshaper

windows
dsp_module

#1

I have just updated Visual Studio 2017, and now when I compile something I got this warning :

c:\sdk\juce5\modules\juce_dsp\processors\juce_waveshaper.h(76): warning C4996: ‘std::result_of<_Fty>’: warning STL4014: std::result_of and std::result_of_t are deprecated in C++17. They are superseded by std::invoke_result and std::invoke_result_t. You can define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file …\JuceLibraryCode\include_juce_dsp.cpp)

I think it should be replaced with std::invoke_result :wink: (or maybe that define for C++17 should be enabled)


#2

Apparently, the last VS 2017 displays a lot of new warnings related with C++17, and the only way to make them diseappear is to use defines, or use the lastest C++ in the properties, but that’s quite annoying !


#3

I had the same issue at work, actually. Even gets worse if you want to have nice features like the two pass compiler (/permissive-). Even gcc and clang are not as stringent when C++17 move is activated (they are still supported things that were removed in the standard).


#4

But the worst part of this is that Visual Studio 2017 15.5+ is slow like hell, with freezes happening when you try to compile even the most simple JUCE app, when Intellisense is requesting something, I had to downgrade to 15.4 to be able to work without throwing my computer through the window :laughing:


#5

Haven’t tried that part yet :confused:
Also from an industrial point of view, having compiler upgrades sometimes every week to fix regressions (15.6 to 15.6.1), leading to potential failures is not something that is sustainable.
But Intellisense is bad in general, I miss Visual Assist :frowning:


#6

And since the beginning of March, they released 15.6.4 and 15.7 is coming out soon… Apparently the latter will fix VS slowness.


#7

So for the moment I’m adding some defines in the VS2017 exporter properties such as _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to remove the warnings…


#8

Hmm I don’t seem to get these warnings when building the demo runner (which uses the wavshaper) on the latest VS 2017 15.6.6.


#9

Hello Fabian !

Sorry it seems that my report was incomplete. I did a few tests and I saw that it happens when the entry “C++ Language Standard” in the Projucer is either “C++17” or “Use latest”, but not with default value or C++14. Strangely enough, I saw this on a new project I created recently, and I don’t remember changing that value, maybe the last version of the Projucer I had set C++17 by default instead of C++14…


#10

Indeed, all these warnings and errors come from C++17 dropping support for some C++03 “features”. And they started also deprecation more C++11 stuff that could be dropped in 2020, I think?
In that regard, they are closer to the standard than GCC which still ships with auto_ptr in C++17 mode.


#11

OK I just fixed these warnings and they will appear on the public repo in a short while.