Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Nov 3, 2010
  1. @toofishes @dustin

    Fix type-punning issues exposed with GCC 4.5.1

    toofishes authored dustin committed
    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 <dan@archlinux.org>
Something went wrong with that request. Please try again.