Browse Source

cast: fix warnings with -Wextra (specifically -Wmissing-field-initializers)

As noted by Jan Engelhardt; libHX fixed this already.
Rusty Russell 14 years ago
parent
commit
b2cc1341c9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      ccan/cast/cast.h

+ 3 - 3
ccan/cast/cast.h

@@ -106,11 +106,11 @@
 	  )
 
 #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))