Repository navigation
fix -Wcast-align in queue_event - #664
Merged
kris-jusiak merged 2 commits intoMay 22, 2026
Merged
Conversation
Both process_event and process_defer_events tracked state changes by comparing only current_state_[0] (first region). A transition in any other region left changed=false, preventing deferred events from being replayed. Fix: compare all regions when detecting state change. Closes #611
dtor_impl took aux::byte* (alignment 1) then reinterpret_cast<T*>, triggering -Wcast-align when T has stricter alignment (e.g. std::string or user-defined over-aligned structs). The storage is already properly aligned via alignas(alignment), so the cast itself is safe — only the type annotation is misleading. Use void* for the dtor function pointer and static_cast in both dtor_impl and move_impl. Closes #636.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #636.
queue_event::dtor_impltookaux::byte*thenreinterpret_cast<T*>, which GCC flags as-Wcast-alignwhen T has alignment stricter than 1 (e.g.std::stringon some ABIs, or explicitly over-aligned types).The storage is already aligned via
alignas(alignment), so the cast is safe — only the parameter type is misleading. Fix: usevoid*for the destructor function pointer andstatic_castin bothdtor_implandmove_impl.