Version: 1.5.6
Frequency: Consistently
Severity: High
Marketplace package name: N/A
Context: SimConnect Samples
Similar MSFS 2020 issue: No bug logged, but this has been in the samples since FSX
Bug description:
All Samples make use of “static enum” to declare constants for Request ids, Client Events, define ids, etc. However, this is invalid in both modern C (which now also knows enums) and C++. It is accepted by Visual Studio, as you can define an enum type and variable in one go, but then “forget” about the variable bit. (so “auto enum" would also be accepted) However, in the Samples the enum declaration is used to introduce (auto-numerated) constants only, not as an actual type for variables.
Since Visual Studio is needed to build SimConnect EXE or DLL applications, this could be overlooked, but for WASM alternative compilers can be used, such as clang, which provide much more extensive QA on your source code, especially when using clang-tidy. Clang will complain about this, as it really is not a valid C++ construct.
Repro steps:
Build the examples using clang.
Attachments: N/A
Private attachments: N/A