libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
532 stars 304 forks source link

bplist: Fix strict aliasing violations #212

Closed MatthewGentoo closed 1 year ago

MatthewGentoo commented 2 years ago

Casting a float pointer to an int pointer is a strict aliasing violation (-Wstrict-aliasing) and is undefined behaviour (although, it did not seem to cause any issues in practice here).

An optimising compiler should elide the memcpys added by this commit.

nikias commented 1 year ago

Merged with 8163aa935e9dcbc15c6c091da7fc42f017fc7ce9.