ISO C++17 does not allow 'register'

Had to update OS from lower Sequoia. I was rebuilding G4.11.2.2 because of new cmake and others and got the errors below. It seems that I may need the flag(s) -Wno-deprecated-register and/or -Wno-register. The file /Users/myusername/Geant/geant4-v11.2.2/config/sys/Darwin-clang.gmk doesn’t list any such flags. I checked 11.3.2 and that file (Darwin-clang.gmk) doesn’t have that flag either. Before I go through the hassle of building 11.3.2 (under the assumption it was fixed there), is this issue known and is there a solution (for 11.2.2)? If there is a solution, is that solution built in to 11.3.2, or do I have to do something else to 11.2.2 and/or 11.3.2? Is the solution external to Geant4, i.e. something that Homebrew can fix?

_Geant4 Version:_11.2.2
_Operating System:_Sequoia 15.5
_Compiler/Version:_clang 16.0.0
_CMake Version:_4.0.2

Sincerely,
Micah

<< The errors at issue >>
In file included from /Users/myusername/Geant/geant4-v11.2.2/source/interfaces/implementation/src/G4UIXm.cc:44:
In file included from /usr/local/include/Xm/CascadeB.h:26:
/usr/local/include/Xm/Xm.h:1514:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1514 | register int from_type,
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1515:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1515 | register int from_val,
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1516:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1516 | register int to_type) ;
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1519:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1519 | register int from_val,
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1520:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1520 | register int from_type) ;
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1523:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1523 | register int from_val,
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1524:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1524 | register int from_type) ;
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1527:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1527 | register int from_val,
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1528:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1528 | register int to_type) ;
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1531:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1531 | register int from_val,
| ^~~~~~~~
/usr/local/include/Xm/Xm.h:1532:25: error: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
1532 | register int to_type) ;
| ^~~~~~~~
11 errors generated.
make[2]: *** [source/CMakeFiles/G4interfaces.dir/interfaces/implementation/src/G4UIXm.cc.o] Error 1
make[1]: *** [source/CMakeFiles/G4interfaces.dir/all] Error 2

The error’s coming from the third party Motif library, and it’s not clear from the details if this was installed manually or through Homebrew. Nominally, I’d strongly recommend disabling use of the Motif UI/Vis in Geant4 on macOS given the age of Motif itself and the more fully featured Qt and VTK drivers available.

If you absolutely need Motif, you could try the Homebrew openmotif formulae as that probably has the best chance of working.

Thanks. I can’t recall the last time I used XM, so I guess I won’t miss it.

Micah