Menu

#560 Newer clang enforces c++17 and results in errors

0.74
open
nobody
None
1
2023-05-10
2023-05-10
No

Seems newer clang (16) enforces c++17 and thus compile of DOSBox fails as Genju reported on irc:

./render_templates_sai.h:46:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                register int r = 0;
                ^~~~~~~~~
./render_templates_sai.h:130:4: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                        register int r = 0;
                        ^~~~~~~~~
./render_templates_sai.h:188:4: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                        register int r = 0;
                        ^~~~~~~~~
In file included from render_scalers.cpp:145:
In file included from ./render_templates.h:464:
./render_templates_sai.h:46:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                register int r = 0;
                ^~~~~~~~~
./render_templates_sai.h:130:4: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                        register int r = 0;
                        ^~~~~~~~~
./render_templates_sai.h:188:4: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                        register int r = 0;
                        ^~~~~~~~~
In file included from render_scalers.cpp:160:
In file included from ./render_templates.h:464:
./render_templates_sai.h:46:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                register int r = 0;
                ^~~~~~~~~
./render_templates_sai.h:130:4: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                        register int r = 0;
                        ^~~~~~~~~
./render_templates_sai.h:188:4: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                        register int r = 0;
                        ^~~~~~~~~
9 errors generated.

adding

#if __cplusplus > 199711L
#define register      // Deprecated in C++11.
#endif  // #if __cplusplus > 199711L

should fix it, or changing "register int" to just "int" a couple of times

as reported by Genju

Discussion


Log in to post a comment.