From: Rusty Russell Date: Mon, 21 Nov 2011 05:17:00 +0000 (+1030) Subject: cast: fix warnings with -Wextra (specifically -Wmissing-field-initializers) X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=b2cc1341c9464b6da4654fd3fa0aafe934fba578 cast: fix warnings with -Wextra (specifically -Wmissing-field-initializers) As noted by Jan Engelhardt; libHX fixed this already. --- diff --git a/ccan/cast/cast.h b/ccan/cast/cast.h index 9f3ecdb7..b108b0c8 100644 --- a/ccan/cast/cast.h +++ b/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))