> Whether or not such aliasing is safe is entirely dependent on
> implementation-defined behavior, the standard leaves it undefined.
This is not true. Matteo already quoted the portion of the C standard
that specifically requires double complex and double[2] to have
exactly the same binary representation.
This thread is somewhat ironic because the binary equivalence between
double[2] and double complex in C99 was designed *precisely* to allow
safe type reinterpretations of the sort that FFTW does. The C++
standard was subsequently amended to mandate exactly the same binary
equivalence for complex<double>, again to allow safe typecasting of
pointers to complex arrays in order to reinterpret them as arrays of
double[2]. (And if I remember correctly, one of the examples used in
the original rationale for this specification was FFT algorithms for
real data, which need to re-interpret an array of real numbers as an
array of complex numbers of half the length.)
Regards,
Steven G. Johnson
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org