I’m getting the following error when building AAX with clang-cl in Visual Studio 2022, latest develop tip, latest AAX SDK.
error : ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
The error comes from a file from the AAX SDK which name I won’t disclose. I’ll just let you know that it concerns “atomics”.
I guess the
register keyword was removed from C++17, but I wonder why there’s no such error when building on macOS. Any idea?
OK, the problem comes from the precompiler conditional expressions in the aforementioned file which only selects portions of code based on either
_MSC_VER being defined. The
_MSC_VER part of code uses the
register keyword while the other doesn’t.
I learnt in the documentation that Clang for Windows does define
_MSC_VER for compatibility reasons, but it does naturally not allow usage of the
register keyword, removed in C++17 (while MSVC apparently does).
So this is an Avid issue. They should refactor the code to get rid of the
register keyword, or use more specific precompiler expressions, e.g.:
#if defined(_MSC_VER) && defined(__clang__)
// running Clang on Windows: do not use 'register'
I wrote to the dev forum about it.
I got an answer from Avid, acknowledging the issue. They filed the bug and said they’ll probably just remove all uses of the register keyboard from their C++ code.
I’ve just run into the same issue, 6mths later (using the latest version of the AAX SDK & JUCE v7.0.8), and emailed Avid for support.
The only workaround I’ve found so far is to compile AAX for PC via the Visual Studio toolset instead of Clang, which is awkward because then compiler optimizations don’t work (which is why I switched to Clang in the first place).
Has anybody found a better path forward on this one? Maybe a question better raised directly with Avid, but is there an edit to their header file that makes the issue go away?
NDA makes it difficult to answer publicly but feel free to PM me if you need help.