fix: replace std::deque with std::vector in HeuristicTree BFS#1304
Open
AMR5210 wants to merge 1 commit into
Open
fix: replace std::deque with std::vector in HeuristicTree BFS#1304AMR5210 wants to merge 1 commit into
AMR5210 wants to merge 1 commit into
Conversation
GCC 14 triggers -Wstrict-overflow=2 inside std::deque internals (_M_create_nodes and _M_destroy_nodes) when the container is used in check_if_structurally_correct(). Both the initializer-list constructor and the destructor inline into the call site, causing the warning to fire as a -Werror build failure on Raspberry Pi OS and other GCC 14 environments. Replace std::deque with std::vector and an index-based front pointer, which avoids the problematic STL code paths entirely. The BFS semantics are unchanged. Fixes: ARM-software#1303 Signed-off-by: AMR5210 <akshaymadavalappil@gmail.com>
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.
GCC 14 triggers -Wstrict-overflow=2 inside std::deque internals
(_M_create_nodes and _M_destroy_nodes) when the container is used in
check_if_structurally_correct(). Both the initializer-list constructor
and the destructor inline into the call site, causing the warning to
fire as a -Werror build failure on Raspberry Pi OS and other GCC 14
environments.
Replace std::deque with std::vector and an index-based front pointer.
std::vector does not have the pointer-comparison loops in its internals
that trigger the warning. The BFS semantics and traversal order are
unchanged.
Testing: Reproduced with g++-14 -std=c++14 -O3 -Wstrict-overflow=2 -Werror.
Before: build fails with two -Wstrict-overflow errors from stl_deque.h:683 and :699.
After: compiles cleanly.
Fixes: #1303