CWPack icon indicating copy to clipboard operation
CWPack copied to clipboard

aliasing violations

Open kjsdf7wr3 opened this issue 3 years ago • 0 comments

Code like the following violates aliasing rules, an object shall only be accessed through its declared type or through a char pointer. I think only the only legal way is to use memcpy (or assembly). Type punning through unions does not help here. https://github.com/clwi/CWPack/blob/d0beec87d3dd7fba8782d6d74a0f73096418e8ae/src/cwpack_internals.h#L54

kjsdf7wr3 avatar Nov 19 '21 17:11 kjsdf7wr3