Linux-LVM Archive mirror
 help / color / mirror / Atom feed
From: Zhao Heming <heming.zhao@suse.com>
To: linux-lvm@redhat.com
Cc: mcsontos@redhat.com, Zhao Heming <heming.zhao@suse.com>
Subject: [linux-lvm] [PATCH] gcc: change zero-sized array to fexlible array
Date: Fri, 21 Aug 2020 00:05:04 +0800	[thread overview]
Message-ID: <1597939504-31532-1-git-send-email-heming.zhao@suse.com> (raw)

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

             reply	other threads:[~2020-08-20 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 16:05 Zhao Heming [this message]
2020-08-20 16:08 ` [linux-lvm] [PATCH] gcc: change zero-sized array to fexlible array 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1597939504-31532-1-git-send-email-heming.zhao@suse.com \
    --to=heming.zhao@suse.com \
    --cc=linux-lvm@redhat.com \
    --cc=mcsontos@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).