From 038760da4f0165b7aa4d0df85a80bd9e9d6acb05 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 22 Aug 2024 14:45:35 +0200 Subject: [PATCH] gcc: single type initializers Older gcc doesn't really like complex types (buffer, struct) to be initialized without extra {} around such type. So pick any other 'single type' var from a struct and set it to 0, rest will do the compiler without emitting a warning. --- lib/activate/dev_manager.c | 2 +- lib/config/config.c | 2 +- tools/lvchange.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 781a478b1..da4af3697 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -449,7 +449,7 @@ static int _ignore_blocked_mirror_devices(struct cmd_context *cmd, struct dm_task *dmt = NULL; int r = 0; char fake_dev_name[16]; - struct device fake_dev = { 0 }; + struct device fake_dev = { .fd = 0 }; struct dm_str_list *alias; if (!(mem = dm_pool_create("blocked_mirrors", 128))) diff --git a/lib/config/config.c b/lib/config/config.c index 7ec25708c..d7fa7d910 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -595,7 +595,7 @@ int config_file_read_from_file(struct dm_config_tree *cft) struct config_source *cs = dm_config_get_custom(cft); struct config_file *cf; struct stat info; - struct device fake_dev = { 0 }; + struct device fake_dev = { .fd = 0 }; struct dm_str_list *alias; int fd; int r; diff --git a/tools/lvchange.c b/tools/lvchange.c index 783bb0b1e..137f1a238 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -814,7 +814,7 @@ static int _lvchange_integrity(struct cmd_context *cmd, struct logical_volume *lv, uint32_t *mr) { - struct integrity_settings settings = { 0 }; + struct integrity_settings settings = { .block_size = 0 }; struct logical_volume *lv_image; struct lv_segment *seg, *seg_image; uint32_t s; -- 2.43.5