Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix type-punning issues exposed with GCC 4.5.1
The errors below are due to pointer magic that isn't allowed if following C strict-aliasing rules: memcached.c: In function ‘complete_incr_bin’: memcached.c:1023:16: error: dereferencing type-punned pointer will break strict-aliasing rules memcached.c:1044:13: error: dereferencing type-punned pointer will break strict-aliasing rules memcached.c:1061:17: error: dereferencing type-punned pointer will break strict-aliasing rules Fix this by introducing a union type that allows access to the uint64_t member as necessary, but doesn't add any additional length to the structure. The size remains the same before and after; the only difference is explict casts are now refactored into union member accesses and all compilers should be happy. Signed-off-by: Dan McGee <[email protected]>
- Loading branch information