[ https://issues.apache.org/jira/browse/THRIFT-5473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fernando Alvarez Junco updated THRIFT-5473: ------------------------------------------- Description: I get a compile error when trying to install the gem thrift v0.15.0 I found one [bugtracker|https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255910] mentioning the same problem and pointing to the flag -Wcompound-token-split-by-macro that seems to be enabled by default starting on the version 12 of clang. Also a patch is provided in the mentioned bugtracker. The error output is: {code:java} Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext /Users/user/.asdf/installs/ruby/2.7.4/bin/ruby -I /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/2.7.0 -r ./siteconf20211018-75929-1w556gv.rb extconf.rb checking for strlcpy() in string.h... yes creating Makefilecurrent directory: /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext make "DESTDIR=" cleancurrent directory: /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext make "DESTDIR=" compiling binary_protocol_accelerated.c binary_protocol_accelerated.c:404:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:404:68: note: '{' token is here VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:404:68: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:404:68: note: ')' token is here VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:406:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:406:68: note: '{' token is here VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:406:68: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:406:68: note: ')' token is here VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:407:71: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:407:71: note: '{' token is here VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:407:71: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:407:71: note: ')' token is here VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:408:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:408:68: note: '{' token is here TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:408:68: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:408:68: note: ')' token is here TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:459:18: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:459:18: note: '{' token is here rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:459:18: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:459:18: note: ')' token is here rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ 10 errors generated. make: *** [binary_protocol_accelerated.o] Error 1make failed, exit code 2Gem files will remain installed in /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0 for inspection. Results logged to /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/thrift-0.15.0/gem_make.out{code} was: I get a compile error when trying to install the gem thrift v0.15.0 I found one [bugtracker|https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255910] mentioning the same problem and pointing to the flag -Wcompound-token-split-by-macro that seems to be enabled by default starting on the version 12 of clang. The error output is: {code:java} Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext /Users/user/.asdf/installs/ruby/2.7.4/bin/ruby -I /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/2.7.0 -r ./siteconf20211018-75929-1w556gv.rb extconf.rb checking for strlcpy() in string.h... yes creating Makefilecurrent directory: /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext make "DESTDIR=" cleancurrent directory: /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext make "DESTDIR=" compiling binary_protocol_accelerated.c binary_protocol_accelerated.c:404:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:404:68: note: '{' token is here VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:404:68: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:404:68: note: ')' token is here VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:406:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:406:68: note: '{' token is here VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:406:68: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:406:68: note: ')' token is here VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:407:71: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:407:71: note: '{' token is here VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:407:71: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:407:71: note: ')' token is here VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:408:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:408:68: note: '{' token is here TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:408:68: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:408:68: note: ')' token is here TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK"))); ^~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:459:18: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ binary_protocol_accelerated.c:459:18: note: '{' token is here rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ binary_protocol_accelerated.c:459:18: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ binary_protocol_accelerated.c:459:18: note: ')' token is here rbuf_ivar_id = rb_intern("@rbuf"); ^~~~~~~~~~~~~~~~~~ /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ 10 errors generated. make: *** [binary_protocol_accelerated.o] Error 1make failed, exit code 2Gem files will remain installed in /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0 for inspection. Results logged to /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/thrift-0.15.0/gem_make.out{code} > Build error on ruby gem v0.15.0 on clang v13.0.0 > ------------------------------------------------ > > Key: THRIFT-5473 > URL: https://issues.apache.org/jira/browse/THRIFT-5473 > Project: Thrift > Issue Type: Bug > Components: C++ - Compiler, Ruby - Compiler, Ruby - Library > Affects Versions: 0.15.0 > Environment: > {code:java} > > ruby -v > ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-darwin20] > {code} > > {code:java} > > gcc -v > Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr > --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 > Apple clang version 13.0.0 (clang-1300.0.29.3) > Target: x86_64-apple-darwin20.6.0 > Thread model: posix > InstalledDir: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin{code} > > > > Reporter: Fernando Alvarez Junco > Priority: Major > > I get a compile error when trying to install the gem thrift v0.15.0 > I found one > [bugtracker|https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255910] > mentioning the same problem and pointing to the flag > -Wcompound-token-split-by-macro that seems to be enabled by default starting > on the version 12 of clang. > Also a patch is provided in the mentioned bugtracker. > > The error output is: > {code:java} > Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current > directory: > /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext > /Users/user/.asdf/installs/ruby/2.7.4/bin/ruby -I > /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/2.7.0 -r > ./siteconf20211018-75929-1w556gv.rb extconf.rb > checking for strlcpy() in string.h... yes > creating Makefilecurrent directory: > /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext > make "DESTDIR=" cleancurrent directory: > /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0/ext > make "DESTDIR=" > compiling binary_protocol_accelerated.c > binary_protocol_accelerated.c:404:68: error: '(' and '{' tokens introducing > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, > rb_intern("BinaryProtocol")); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:404:68: note: '{' token is here > VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, > rb_intern("BinaryProtocol")); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > { \ > ^ > binary_protocol_accelerated.c:404:68: error: '}' and ')' tokens terminating > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, > rb_intern("BinaryProtocol")); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > } > ^ > binary_protocol_accelerated.c:404:68: note: ')' token is here > VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, > rb_intern("BinaryProtocol")); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:406:68: error: '(' and '{' tokens introducing > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_1"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:406:68: note: '{' token is here > VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_1"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > { \ > ^ > binary_protocol_accelerated.c:406:68: error: '}' and ')' tokens terminating > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_1"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > } > ^ > binary_protocol_accelerated.c:406:68: note: ')' token is here > VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_1"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:407:71: error: '(' and '{' tokens introducing > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:407:71: note: '{' token is here > VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > { \ > ^ > binary_protocol_accelerated.c:407:71: error: '}' and ')' tokens terminating > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > } > ^ > binary_protocol_accelerated.c:407:71: note: ')' token is here > VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("VERSION_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:408:68: error: '(' and '{' tokens introducing > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("TYPE_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:408:68: note: '{' token is here > TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("TYPE_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > { \ > ^ > binary_protocol_accelerated.c:408:68: error: '}' and ')' tokens terminating > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("TYPE_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > } > ^ > binary_protocol_accelerated.c:408:68: note: ')' token is here > TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, > rb_intern("TYPE_MASK"))); > > ^~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:459:18: error: '(' and '{' tokens introducing > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > rbuf_ivar_id = rb_intern("@rbuf"); > ^~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > binary_protocol_accelerated.c:459:18: note: '{' token is here > rbuf_ivar_id = rb_intern("@rbuf"); > ^~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1832:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > { \ > ^ > binary_protocol_accelerated.c:459:18: error: '}' and ')' tokens terminating > statement expression appear in different macro expansion contexts > [-Werror,-Wcompound-token-split-by-macro] > rbuf_ivar_id = rb_intern("@rbuf"); > ^~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:24: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1837:5: > note: expanded from macro 'RUBY_CONST_ID_CACHE' > } > ^ > binary_protocol_accelerated.c:459:18: note: ')' token is here > rbuf_ivar_id = rb_intern("@rbuf"); > ^~~~~~~~~~~~~~~~~~ > /Users/user/.asdf/installs/ruby/2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:56: > note: expanded from macro 'rb_intern' > __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ > ^ > 10 errors generated. > make: *** [binary_protocol_accelerated.o] Error 1make failed, exit code 2Gem > files will remain installed in > /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/thrift-0.15.0 > for inspection. > Results logged to > /Users/user/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/thrift-0.15.0/gem_make.out{code} -- This message was sent by Atlassian Jira (v8.3.4#803005)