On 12 Oct 2022 13:38, Andrew Burgess via Gdb-patches wrote: > When building the erc32 simulator I get a few warnings like this: > > /tmp/build/sim/../../src/sim/erc32/exec.c:1377:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] > 1377 | sregs->fs[rd] = *((float32 *) & ddata[0]); > | ~^~~~~~~~~~~~~~~~~~~~~~~ > > The type of '& ddata[0]' will be 'uint32_t *', which is what triggers > the warning. > > This commit uses an intermediate pointer of type 'char *' when > performing the type-punning, which is well-defined behaviour, and will > silence the above warning. this is kind of a poor fix. if we can't arrange for the pointers to be the right type, at least a memcpy would be better. -mike