All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yi Zhang <yi.zhang@redhat.com>
To: osandov@osandov.com
Cc: linux-block@vger.kernel.org, sunke32@huawei.com
Subject: [PATCH blktests] nbd/003: fix compiling error with gcc version 4.8.5
Date: Thu, 20 Feb 2020 22:46:49 +0800	[thread overview]
Message-ID: <20200220144649.16881-1-yi.zhang@redhat.com> (raw)

cc  -O2 -Wall -Wshadow   -o mount_clear_sock mount_clear_sock.c
mount_clear_sock.c: In function ‘main’:
mount_clear_sock.c:39:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < loops; i++) {
  ^
mount_clear_sock.c:39:2: note: use option -std=c99 or -std=gnu99 to compile your code

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
---
 src/mount_clear_sock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mount_clear_sock.c b/src/mount_clear_sock.c
index 4030a4a..984395e 100644
--- a/src/mount_clear_sock.c
+++ b/src/mount_clear_sock.c
@@ -18,7 +18,7 @@
 int main(int argc, char **argv)
 {
 	const char *mountpoint, *dev, *fstype;
-	int loops, fd;
+	int loops, fd, i;
 
 	if (argc != 5) {
 		fprintf(stderr, "usage: %s DEV MOUNTPOINT FSTYPE LOOPS", argv[0]);
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
 		return EXIT_FAILURE;
 	}
 
-	for (int i = 0; i < loops; i++) {
+	for (i = 0; i < loops; i++) {
 		pid_t mount_pid, clear_sock_pid;
 		int wstatus;
 
-- 
2.21.0


             reply	other threads:[~2020-02-20 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 14:46 Yi Zhang [this message]
2020-03-04 18:17 ` [PATCH blktests] nbd/003: fix compiling error with gcc version 4.8.5 Omar Sandoval

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=20200220144649.16881-1-yi.zhang@redhat.com \
    --to=yi.zhang@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=sunke32@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.