I'm not super familiar with C++14 & C++20, so it's good to know.
Message: 1Date: Sun, 9 Feb 2020 02:29:49 +0100From: Christof Ressi <info@christofressi.com>To: pd-dev@lists.iem.atSubject: Re: [PD-dev] Tips on debugging dip crashes?Message-ID: <f1514d4a-dc01-cb71-f271-98e53ca7a629@christofressi.com>Content-Type: text/plain; charset="windows-1252"; Format="flowed"by applying a union used in one part of the code to another to
replace a dereferencing castType punning via pointer casts often violates the "strict aliasing rules" and the compiler might do wonky optimizations. Type punning via unions, on the other hand, is explicitly allowed in C. It is *not* allowed in C++, although in practice I haven't encountered a case where it didn't work. (The legal way to do type punning in C++ has been memcpy() , which gets fully optimized away; C++20 finally has std::bit_cast()).You probably know this anyway. Just writing for other people who are reading :-)Christof