2b039d5f20
include/rte_ip.h:161: error: dereferencing pointer ‘u16’ does break strict-aliasing rules include/rte_ip.h:157: note: initialized from here ... The root cause is that, compile enable strict aliasing by default, while in function rte_raw_cksum() try to convert 'const char *' to 'const uint16_t *'. This workaround is to solve the compile issue of GCC strict-aliasing (two different type pointers should not be point to the same memory address). For GCC 4.4.7 it will definitely occurs if flags "-fstrict-aliasing" and "-Wall" used. Signed-off-by: Michael Qiu <michael.qiu@intel.com> [Thomas: add workaround comment] Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>