Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simdjson: ISO C++17 does not allow 'register' storage class specifier simdjson #1924

Closed
deepj opened this issue Feb 24, 2020 · 2 comments
Closed
Assignees
Milestone

Comments

@deepj
Copy link

deepj commented Feb 24, 2020

truffleruby 20.1.0-dev-08311e22, like ruby 2.6.5, GraalVM CE Native [x86_64-darwin]

To reproduce:

$ gem install simdjson

Error:

Fetching simdjson-0.2.0.gem
Building native extensions. This could take a while...
ERROR:  Error installing simdjson:
	ERROR: Failed to build gem native extension.

    current directory: ~/.gem/truffleruby/2.6.5/gems/simdjson-0.2.0/ext/simdjson
~/.rubies/truffleruby-dev/bin/truffleruby -I ~/.rubies/truffleruby-dev/lib/mri -r ./siteconf20200224-84741-1hdzy5a.rb extconf.rb
creating Makefile

current directory: ~/.gem/truffleruby/2.6.5/gems/simdjson-0.2.0/ext/simdjson
make "DESTDIR=" clean

current directory: ~/.gem/truffleruby/2.6.5/gems/simdjson-0.2.0/ext/simdjson
make "DESTDIR="
compiling simdjson.cpp
In file included from simdjson.cpp:5:
In file included from ./simdjson.hpp:4:
In file included from ~/.rubies/truffleruby-dev/lib/cext/include/ruby.h:33:
~/.rubies/truffleruby-dev/lib/cext/include/ruby/ruby.h:902:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]
struct RUBY_ALIGNAS(SIZEOF_VALUE) RBasic {
^
In file included from simdjson.cpp:5:
In file included from ./simdjson.hpp:4:
In file included from ~/.rubies/truffleruby-dev/lib/cext/include/ruby.h:33:
In file included from ~/.rubies/truffleruby-dev/lib/cext/include/ruby/ruby.h:1939:
~/.rubies/truffleruby-dev/lib/cext/include/ruby/intern.h:56:19: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
~/.rubies/truffleruby-dev/lib/cext/include/ruby/intern.h:56:36: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
1 warning and 2 errors generated.
make: *** [simdjson.o] Error 1

make failed, exit code 2

Gem files will remain installed in ~/.gem/truffleruby/2.6.5/gems/simdjson-0.2.0 for inspection.
Results logged to ~/.gem/truffleruby/2.6.5/extensions/x86_64-darwin/20.1.0-dev-08311e22/simdjson-0.2.0/gem_make.out
@eregon
Copy link
Member

eregon commented Feb 24, 2020

The same warning happens on MRI 2.6.5 too with gcc, except there it's a warning and not an error:

compiling simdjson.cpp
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
In file included from /home/eregon/.rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/ruby.h:2111,
                 from /home/eregon/.rubies/ruby-2.6.5/include/ruby-2.6.0/ruby.h:33,
                 from simdjson.hpp:4,
                 from simdjson.cpp:5:
/home/eregon/.rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/intern.h:56:33: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
 void rb_mem_clear(register VALUE*, register long);
                                 ^
/home/eregon/.rubies/ruby-2.6.5/include/ruby-2.6.0/ruby/intern.h:56:45: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
 void rb_mem_clear(register VALUE*, register long);
                                             ^~~~

Since the warning comes from ruby/intern.h it should be fixed in TruffleRuby, as done in MRI in ruby/ruby@113bef6.

@deepj
Copy link
Author

deepj commented Feb 24, 2020

@eregon Ah, I tested it only on MRI 2.7.0 where it works

$ gem install simdjson
Fetching simdjson-0.2.0.gem
Building native extensions. This could take a while...
Successfully installed simdjson-0.2.0
1 gem installed
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants