https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108342

--- Comment #12 from Rui Oliveira <ruilvo at ua dot pt> ---
(In reply to Jakub Jelinek from comment #11)

> No, if you have the packed ph_fcomplex_t not aligned at alignof (float), you
> need
> to copy it to a properly aligned variable before trying to reinterpret_cast
> it.

Some `if constexpr` comparing of the remainder between
alignof(std::complex<float>) and (alignof(bb_frame_t) +
offsetof(bb_iq_samples)) could perhaps make one avoid that. But that's just a
side idea to think of.

Main point is, the code is de-serializing a serial stream. I do not expect to
find the "magic" word at the right aligment for `bb_frame_t` anyway, so
generous memcpy'ing to properly aligned variables will be required anyway.

Reply via email to