|
|
|
05-05-2021, 10:22 PM
|
#1
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
|
reaper_plugin.h and C++ FLAG /std:c++latest
When I set this flag with the current Visual Studio C++ compiler, the file reaper_plugin.h (in the Reaper SDK) issues an error in the "typedef struct ... PCM_source_peaktransfer_t" instruction.
When using the "standard" (I suppose C++14) setting, it happily does compile the file.
-Michael
Last edited by mschnell; 05-06-2021 at 05:31 AM.
|
|
|
05-06-2021, 09:07 AM
|
#2
|
Human being with feelings
Join Date: Feb 2005
Location: Greece
Posts: 100
|
For those who do not have the current MSVC, could you post the error in case someone is able to make a guess?
|
|
|
05-06-2021, 11:02 AM
|
#3
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
|
The error is
"{
"resource": "/C:/Users/Michael Schnell/JUCE/include/vendor/reaper-sdk/sdk/reaper_plugin.h",
"owner": "cmake-build-diags",
"code": "C7626",
"severity": 8,
"message": "Eine unbenannte Klasse, die im typedef-Namen verwendet wird, kann keine anderen Member als nicht statische Datenmember, Memberenumerationen oder Memberklassen deklarieren. [C:\\Users\\Michael Schnell\\JUCE\\JUCE-reaper-embedded-fx-gui\\build\\AudioPluginExample.vcxproj]",
"source": "MSVC",
"startLineNumber": 363,
"startColumn": 1,
"endLineNumber": 363,
"endColumn": 1
}"
(Sorry for German text which I can't seem to be able to alter.)
In fact this "latest" version does not distinguish between class and struct. (The class keyword is not used in any vicinity).
And seemingly this syntax is forbidden in that future.
-Michael
|
|
|
05-06-2021, 11:54 AM
|
#4
|
Human being with feelings
Join Date: Feb 2005
Location: Greece
Posts: 100
|
Sorry, looks like I cannot suggest something useful regarding the error but maybe you can get lucky from another person. As a general advice the REAPER SDK and WDL use C++98 features so it would make sense not to go above C++14 standard; C++17 introduced some feature removals and deprecations regarding the language so maybe it's something related to that that affects the compilation. Alternatively, maybe /std:c++latest has introduced better or buggy conformance that causing problems; from a conservative point of view it is recommended to not use /std:c++latest in production to avoid incoming changes to disrupt your codebase with every VS update but then again some people prefer cutting edge.
|
|
|
05-06-2021, 05:00 PM
|
#5
|
Human being with feelings
Join Date: Feb 2005
Location: Greece
Posts: 100
|
I had a second look and I think your question is answered here.
Below I quote the text just in case the link becomes unreachable in the future:
Quote:
Unnamed classes within a typedef declaration can't have any members other than:
- non-static data members with no default member initializers,
- member classes, or
- member enumerations.
The same restrictions are applied recursively to each nested class. The restriction is meant to ensure the simplicity of structs that have typedef names for linkage purposes. They must be simple enough that no linkage calculations are necessary before the compiler gets to the typedef name for linkage.
This warning is new in Visual Studio 2019 version 16.6. Based on P1766R1 adopted by the C++ standards committee as a defect report, it affects all standards modes of the compiler. In default /std:c++14 and /std:c++17 modes, the compiler emits warning C5208 for non-conforming code. If /permissive- is specified, the compiler emits warning C5208 as an error under /std:c++14 and emits error C7626 under /std:c++17. The compiler emits error C7626 for non-conforming code when /std:c++latest is specified.
|
|
|
|
05-07-2021, 03:26 AM
|
#6
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
|
Happily I could just use the standard instead of "latest" for the project.
But maybe the devs might want to revise the file at that point...
Thanks,
-Michael
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:54 AM.
|