Skip to content

Conversation

@Lgt2x
Copy link
Member

@Lgt2x Lgt2x commented May 21, 2025

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

Fix compilation for clang when setting C++ standard to 26 (set(CMAKE_CXX_STANDARD 26))

Related Issues

Additions to #686 for clang. #686 only handled GCC compilation

Lgt2x added 2 commits May 21, 2025 23:13
since C++20, 'module' is a reserved keyword
This prevented compilation using clang++ and C++ 26 standard:

error: comparison between two arrays is ill-formed in C++26; to compare array addresses, use unary '+' to decay operands to pointers [-Warray-compare-cxx26]

if (static_wb->anim_start_frame != static_wb->anim_end_frame) {
// LGT: Awkward array comparison by pointer, needs investivation to understand the actual intent
if (+static_wb->anim_start_frame != static_wb->anim_end_frame) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Because both LHS and RHS are arrays in their own right, the comparison always evaluates to true and should be deleted altogether.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right this test is bogus, I kept it alive to highlight a potential bug that needs to be looked into.

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