Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Compatibility

Reply
 
Thread Tools Display Modes
Old 05-05-2021, 10:22 PM   #1
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
Default 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.
mschnell is online now   Reply With Quote
Old 05-06-2021, 09:07 AM   #2
Tranquil
Human being with feelings
 
Join Date: Feb 2005
Location: Greece
Posts: 100
Default

For those who do not have the current MSVC, could you post the error in case someone is able to make a guess?
Tranquil is offline   Reply With Quote
Old 05-06-2021, 11:02 AM   #3
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
Default

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
mschnell is online now   Reply With Quote
Old 05-06-2021, 11:54 AM   #4
Tranquil
Human being with feelings
 
Join Date: Feb 2005
Location: Greece
Posts: 100
Default

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.
Tranquil is offline   Reply With Quote
Old 05-06-2021, 05:00 PM   #5
Tranquil
Human being with feelings
 
Join Date: Feb 2005
Location: Greece
Posts: 100
Default

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.
Tranquil is offline   Reply With Quote
Old 05-07-2021, 03:26 AM   #6
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
Default

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
mschnell is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.