mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Enable -Wstrict-aliasing=1 (GCC)
Fixed partially.
This commit is contained in:
parent
3990e2d3e6
commit
a4fdbf0a88
34 changed files with 141 additions and 81 deletions
|
|
@ -258,6 +258,12 @@ namespace stx
|
|||
r.m_ptr = static_cast<decltype(r.m_ptr)>(std::exchange(m_ptr, nullptr));
|
||||
return r;
|
||||
}
|
||||
|
||||
// Raw access for make_single()
|
||||
auto& raw() noexcept
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
|
@ -302,11 +308,11 @@ namespace stx
|
|||
|
||||
if constexpr (std::is_array_v<T>)
|
||||
{
|
||||
reinterpret_cast<etype*&>(r) = +ptr->m_data;
|
||||
r.raw() = +ptr->m_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
reinterpret_cast<etype*&>(r) = &ptr->m_data;
|
||||
r.raw() = &ptr->m_data;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
|
@ -370,7 +376,7 @@ namespace stx
|
|||
};
|
||||
|
||||
single_ptr<T> r;
|
||||
reinterpret_cast<std::remove_extent_t<T>*&>(r) = std::launder(arr);
|
||||
r.raw() = std::launder(arr);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue