From befe0078ad15563967d8b8321638c75a4f25f438 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 12 Feb 2016 10:17:39 +0100 Subject: [PATCH] gcc: better code for older compiler Address this gcc warning: metadata/lv.c:243: warning: initialized field overwritten metadata/lv.c:243: warning: (near initialization for 'status.seg_status') Present with e.g.: gcc version 4.3.2 (Debian 4.3.2-1.1) --- lib/metadata/lv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c index c4e3437d2..526284eea 100644 --- a/lib/metadata/lv.c +++ b/lib/metadata/lv.c @@ -238,8 +238,10 @@ char *lvseg_kernel_discards_dup(struct dm_pool *mem, const struct lv_segment *se { char *ret = NULL; struct lv_with_info_and_seg_status status = { - .seg_status.type = SEG_STATUS_NONE, - .seg_status.seg = seg + .seg_status = { + .type = SEG_STATUS_NONE, + .seg = seg + }, }; if (!lv_is_thin_pool(seg->lv)) -- 2.43.5