Skip to content

fix: replace std::deque with std::vector in HeuristicTree BFS#1304

Open
AMR5210 wants to merge 1 commit into
ARM-software:mainfrom
AMR5210:fix/strict-overflow-heuristic-tree
Open

fix: replace std::deque with std::vector in HeuristicTree BFS#1304
AMR5210 wants to merge 1 commit into
ARM-software:mainfrom
AMR5210:fix/strict-overflow-heuristic-tree

Conversation

@AMR5210

@AMR5210 AMR5210 commented Jul 18, 2026

Copy link
Copy Markdown

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

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>
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.

OpenCL compile failure with Werror-1 on Raspberry Pi 5 / Pi OS

1 participant