goccy / p5-Compiler-Lexer

Lexical Analyzer for Perl5
Other
46 stars 17 forks source link

error: ISO C++17 does not allow 'register' storage class specifier #89

Open eserte opened 10 months ago

eserte commented 10 months ago

Compilation fails on newer FreeBSD systems (e.g. 14, 15):

...
cc -Isrc -I/usr/perl5.38.2/lib/5.38.2/aarch64-freebsd/CORE -DPIC -fPIC -Iinclude -Wno-missing-field-initializers -g3 -xc++ -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -O2 -pipe -o src/compiler/util/Compiler_double_charactor_operator.o src/compiler/util/Compiler_double_charactor_operator.cpp
src/compiler/util/Compiler_double_charactor_operator.cpp:9:54: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
inline unsigned int DoubleCharactorOperatorMap::hash(register const char *str)
                                                     ^~~~~~~~~
src/compiler/util/Compiler_double_charactor_operator.cpp:42:53: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
const char *DoubleCharactorOperatorMap::in_word_set(register const char *str)
                                                    ^~~~~~~~~
src/compiler/util/Compiler_double_charactor_operator.cpp:189:2: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register int key = hash(str);
        ^~~~~~~~~
src/compiler/util/Compiler_double_charactor_operator.cpp:191:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                register const char *s = double_charactor_operators[key];
                ^~~~~~~~~
4 errors generated.
error building src/compiler/util/Compiler_double_charactor_operator.o from 'src/compiler/util/Compiler_double_charactor_operator.cpp' at /usr/perl5.38.2/lib/5.38.2/ExtUtils/CBuilder/Base.pm line 185, <DATA> line 1.
...