[MacPorts] #58255: ruby +universal: config.h: error: invalid suffix on literal; C++11 requires a space between literal and identifier

MacPorts noreply at macports.org
Wed Mar 27 20:53:33 UTC 2019


#58255: ruby +universal: config.h: error: invalid suffix on literal; C++11 requires
a space between literal and identifier
-------------------------+-------------------------------------------------
 Reporter:  ryandesign   |      Owner:  kimuraw
     Type:  defect       |     Status:  assigned
 Priority:  Normal       |  Milestone:
Component:  ports        |    Version:
 Keywords:               |       Port:  ruby19 ruby21 ruby22 ruby23 ruby24
                         |  ruby25 ruby26
-------------------------+-------------------------------------------------
 When installed with the +universal variant, most of the ruby ports install
 a config.h that is incompatible with C++11, at least in recent versions of
 clang; this causes software that compiles ruby modules with C++11 to fail:

 {{{
 :info:build /opt/local/include/ruby-2.1.0/universal-
 darwin17/ruby/config.h:340:31: error: invalid suffix on literal; C++11
 requires a space between literal and identifier [-Wreserved-user-defined-
 literal]
 :info:build #define RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 :info:build                               ^
 :info:build
 :info:build /opt/local/include/ruby-2.1.0/universal-
 darwin17/ruby/config.h:341:35: error: invalid suffix on literal; C++11
 requires a space between literal and identifier [-Wreserved-user-defined-
 literal]
 :info:build #define RUBY_PLATFORM
 "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 :info:build                                   ^
 :info:build
 :info:build /opt/local/include/ruby-2.1.0/universal-
 darwin17/ruby/config.h:341:55: error: invalid suffix on literal; C++11
 requires a space between literal and identifier [-Wreserved-user-defined-
 literal]
 :info:build #define RUBY_PLATFORM
 "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 :info:build                                                       ^
 :info:build
 :info:build 3 errors generated.
 }}}

 {{{
 $ port installed | grep 'ruby.*+universal'
   ruby @1.8.7-p374_7+universal (active)
   ruby19 @1.9.3-p551_8+doc+universal (active)
   ruby20 @2.0.0-p648_6+universal (active)
   ruby21 @2.1.9_5+universal (active)
   ruby22 @2.2.10_3+universal (active)
   ruby23 @2.3.8_2+universal (active)
   ruby24 @2.4.5_2+universal (active)
   ruby25 @2.5.3_2+universal (active)
   ruby26 @2.6.1_0+universal (active)
 }}}
 {{{
 $ grep universal /opt/local/include/ruby*/*/ruby/config.h
 /opt/local/include/ruby-1.9.1/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-1.9.1/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.1.0/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.1.0/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.2.0/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.2.0/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.3.0/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.3.0/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.4.0/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.4.0/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.5.0/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.5.0/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.6.0/universal-darwin17/ruby/config.h:#define
 RUBY_ARCH "universal-"RUBY_PLATFORM_OS
 /opt/local/include/ruby-2.6.0/universal-darwin17/ruby/config.h:#define
 RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
 }}}

 ruby and ruby20 seem to be unaffected. But the other ports are.

 Even the versions of ruby Apple ships with macOS exhibit this problem.

 I imagine the fix is as simple as adding spaces where needed.

 The problem needs to be reported to the developers of ruby so that they
 can fix it in all of the supported versions of ruby, but we'll probably
 need to backport the patch to those versions that we have in MacPorts that
 are no longer supported.

-- 
Ticket URL: <https://trac.macports.org/ticket/58255>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list