linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH] gcc: change zero-sized array to fexlible array
@ 2020-08-20 16:05 Zhao Heming
  2020-08-20 16:08 ` heming.zhao
  2020-08-26  5:18 ` heming.zhao
  0 siblings, 2 replies; 7+ messages in thread
From: Zhao Heming @ 2020-08-20 16:05 UTC (permalink / raw)
  To: linux-lvm; +Cc: mcsontos, Zhao Heming

this patch makes gcc happy with compiling option: [-Wstringop-overflow=]

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
---
 device_mapper/libdm-common.c | 2 +-
 lib/activate/fs.c            | 2 +-
 libdm/libdm-common.c         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/device_mapper/libdm-common.c b/device_mapper/libdm-common.c
index bc691d6..3627457 100644
--- a/device_mapper/libdm-common.c
+++ b/device_mapper/libdm-common.c
@@ -1445,7 +1445,7 @@ struct node_op_parms {
 	char *old_name;
 	int warn_if_udev_failed;
 	unsigned rely_on_udev;
-	char names[0];
+	char names[];
 };
 
 static void _store_str(char **pos, char **ptr, const char *str)
diff --git a/lib/activate/fs.c b/lib/activate/fs.c
index b2c99fc..96f7df6 100644
--- a/lib/activate/fs.c
+++ b/lib/activate/fs.c
@@ -313,7 +313,7 @@ struct fs_op_parms {
 	char *lv_name;
 	char *dev;
 	char *old_lv_name;
-	char names[0];
+	char names[];
 };
 
 static void _store_str(char **pos, char **ptr, const char *str)
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index d75c704..d587c32 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -1443,7 +1443,7 @@ struct node_op_parms {
 	char *old_name;
 	int warn_if_udev_failed;
 	unsigned rely_on_udev;
-	char names[0];
+	char names[];
 };
 
 static void _store_str(char **pos, char **ptr, const char *str)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-03 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 16:05 [linux-lvm] [PATCH] gcc: change zero-sized array to fexlible array Zhao Heming
2020-08-20 16:08 ` heming.zhao
2020-08-26  5:18 ` heming.zhao
2020-08-28 19:32   ` Zdenek Kabelac
2020-08-29  3:11     ` heming.zhao
2020-09-02 15:22       ` Zdenek Kabelac
2020-09-03 14:58         ` heming.zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).