cast: fix warnings with -Wextra (specifically -Wmissing-field-initializers)
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 21 Nov 2011 05:17:00 +0000 (15:47 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 21 Nov 2011 05:17:00 +0000 (15:47 +1030)
As noted by Jan Engelhardt; libHX fixed this already.

ccan/cast/cast.h

index 9f3ecdb7179e78ae9fdea84e801252b989d5f540..b108b0c864d3b0cd07e26a497040537921d674b4 100644 (file)
          )
 
 #define cast_const_strip1(expr)                        \
-       __typeof__(*(struct { int z; __typeof__(expr) x; }){0}.x)
+       __typeof__(*(union { int z; __typeof__(expr) x; }){0}.x)
 #define cast_const_strip2(expr) \
-       __typeof__(**(struct { int z; __typeof__(expr) x; }){0}.x)
+       __typeof__(**(union { int z; __typeof__(expr) x; }){0}.x)
 #define cast_const_strip3(expr) \
-       __typeof__(***(struct { int z; __typeof__(expr) x; }){0}.x)
+       __typeof__(***(union { int z; __typeof__(expr) x; }){0}.x)
 #define cast_const_compat1(expr, type)                                 \
        __builtin_types_compatible_p(cast_const_strip1(expr),           \
                                     cast_const_strip1(type))