]> sourceware.org Git - lvm2.git/commitdiff
gcc: change zero-sized array to fexlible array
authorZhao Heming <heming.zhao@suse.com>
Thu, 20 Aug 2020 16:05:04 +0000 (00:05 +0800)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 1 Sep 2020 15:57:50 +0000 (17:57 +0200)
this patch makes gcc happy with compiling option: [-Wstringop-overflow=]

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
device_mapper/libdm-common.c
lib/activate/fs.c
libdm/libdm-common.c

index b6d08f5571f70c1dd4b3177fee444fb31c605472..9b87e4e744e363a96624d28bbc3818eb7d0d6a5b 100644 (file)
@@ -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)
index b2c99fc06fa2e57a7e3d25d5c6d102e718234565..96f7df678b8ed6bbcffee6871e681647c1d2095f 100644 (file)
@@ -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)
index 466c74bb9722553b99b876cdfb7b638b382e7142..a28829765a1b58767aae7b5c6ec42ee302a68c39 100644 (file)
@@ -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)
This page took 0.047113 seconds and 5 git commands to generate.