]> git.ipfire.org Git - thirdparty/lldpd.git/commit
marshal: circumvent cast alignment problems using memcpy
authorVincent Bernat <bernat@luffy.cx>
Thu, 26 Jan 2012 22:52:13 +0000 (23:52 +0100)
committerVincent Bernat <bernat@luffy.cx>
Thu, 26 Jan 2012 22:52:13 +0000 (23:52 +0100)
commit6578dc6a7cc8cb38330253d4e34606a500feb5a7
tree0d1c268ecb7c4e7f4035614ca197e4fd7524a1ba
parent0c0991d8ced81ee76b7b1c0c83185a25cceee529
marshal: circumvent cast alignment problems using memcpy

gcc was issuing warnings like this:
 marshal.c:290:5: warning: cast increases required alignment of target type [-Wcast-align]

They are harmless because for one of them, the target has been
malloced (and therefore is safely aligned to 8 bytes) and for the
other because we know that the target location is the location of a
pointer. For those later cases, assignment is replaced by memcpy().
src/marshal.c