FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Disable spurious gcc warning in `xfunction::broadcast_shape` by hsanzg · Pull Request #2816 · xtensor-stack/xtensor · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .hpp  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 7 additions & 1 deletion include/xtensor/xfunction.hpp
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
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ namespace xt

tuple_type m_e;
functor_type m_f;
mutable xfunction_cache<detail::promote_index<typename std::decay_t<CT>::shape_type...>> m_cache;
mutable xfunction_cache<detail::promote_index<typename std::decay_t<CT>::shape_type...>> m_cache{};

friend class xfunction_iterator<F, CT...>;
friend class xfunction_stepper<F, CT...>;
Expand Down Expand Up @@ -721,7 +721,13 @@ namespace xt
{
if (m_cache.is_initialized && reuse_cache)
{
// Disable spurious warning when copying into a 1-sized `std::array`
// in gcc >= 12.4.0; see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107852
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
std::copy(m_cache.shape.cbegin(), m_cache.shape.cend(), shape.begin());
#pragma GCC diagnostic pop
return m_cache.is_trivial;
}
else
Expand Down

Back | FazBrowse Home | New Git URL