Skip to content

Conversation

@stefanb2
Copy link
Contributor

C++20 changed the type uf u8"str" to char8_t, which can't be assigned to a char pointer without casting.

  • replace "constexpr" with "const" array, because reinterpret_cast is per C++ standard not a constant expression
  • move array initialization from the class declaration to the class implementation, just like the two color arrays
  • wrap u8 strings in "reinterpret_cast< const char* >()" to make a C++20 compiler happy

@stefanb2
Copy link
Contributor Author

stefanb2 commented Jan 27, 2026

This fixes the FTBFS on Fedora 44 mass-rebuild with GCC 16.

C++20 changed the type uf u8"str" to char8_t, which can't be assigned to
a char pointer without casting.

- replace "constexpr" with "const" array, because reinterpret_cast is
  per C++ standard not a constant expression
- move array initialization from the class declaration to the class
  implementation, just like the two color arrays
- wrap u8 strings in "reinterpret_cast< const char* >()" to make a C++20
  compiler happy
@stefanb2 stefanb2 force-pushed the topic-fix-build-with-cplusplus20 branch from d96080c to cde65d6 Compare January 27, 2026 10:09
@stefanb2
Copy link
Contributor Author

Installer packaging step in Windows build is broken, because makensis command can't be found. Fixing this issue is outside the scope of this PR.

@stefanb2
Copy link
Contributor Author

Installer packaging step in Windows build is broken, because makensis command can't be found. Fixing this issue is outside the scope of this PR.

This issue is addressed by PR #60.

Copy link
Owner

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.
We could directly set the C++ standard to 20 in the CMakeLists.txt (set (CMAKE_CXX_STANDARD 20)), then it's also used for older compilers.

@bkueng bkueng merged commit 2b222bc into bkueng:main Jan 29, 2026
21 of 23 checks passed
@stefanb2 stefanb2 deleted the topic-fix-build-with-cplusplus20 branch January 29, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants