[MacPorts] #74190: qt4-mac @4.8.7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]

MacPorts noreply at macports.org
Mon Jul 6 20:26:45 UTC 2026


#74190: qt4-mac @4.8.7: error: ISO C++17 does not allow 'register' storage class
specifier [-Wregister]
------------------------+-----------------------
 Reporter:  ryandesign  |      Owner:  michaelld
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.12.5
 Keywords:  lion        |       Port:  qt4-mac
------------------------+-----------------------
 qt4-mac does not build on Lion (only).

 https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/258347/steps
 /install-port/logs/stdio

 {{{
 /opt/local/var/macports/build/qt4-mac-3415a329/work/qt-everywhere-
 opensource-
 src-4.8.7/include/QtCore/private/../../../src/corelib/kernel/qcore_unix_p.h:312:5:
 error: ISO C++17 does not allow 'register' storage class specifier
 [-Wregister]
     register int ret;
     ^~~~~~~~~
 }}}

 So MacPorts has chosen a newer compiler that defaults to C++17, but the
 qt4-mac codebase is not compatible with C++17.

 Even C++11 support is experimental and hidden behind the cxx11 variant.

 The solution would seem to be to tell the build to use C++98 (the C++
 standard before C++11) unless the cxx11 variant is selected.

 I tried to do this by adding this code:

 {{{#!tcl
 if {![variant_isset cxx11]} {
     compiler.cxx_standard 1998
     configure.cxxflags-append -std=c++98
 }
 }}}

 This failed the same way because the build does not seem to honor
 `configure.cxxflags`.

 Then I tried:

 {{{#!tcl
 if {![variant_isset cxx11]} {
     compiler.cxx_standard 1998
     configure.cxx-append -std=c++98
 }
 }}}

 This failed because the build assumes that `configure.cxx` is solely the
 compiler path.

 I give up.

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


More information about the macports-tickets mailing list