https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108342
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Rui Oliveira from comment #10) > So my options are to create like a placeholder, say > > ```c > typedef struct __attribute__((__packed__)) // Packed isn't really necessary > here I think? > { > float re, im; > } ph_fcomplex_t > > ``` > > To silence the warning and get packing to work, and trust > [complex.numbers.general] for a reinterpret_cast into std::complex<float> I > guess. 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.