All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests] nbd/003: fix compiling error with gcc version 4.8.5
@ 2020-02-20 14:46 Yi Zhang
  2020-03-04 18:17 ` Omar Sandoval
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Zhang @ 2020-02-20 14:46 UTC (permalink / raw)
  To: osandov; +Cc: linux-block, sunke32

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


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

* Re: [PATCH blktests] nbd/003: fix compiling error with gcc version 4.8.5
  2020-02-20 14:46 [PATCH blktests] nbd/003: fix compiling error with gcc version 4.8.5 Yi Zhang
@ 2020-03-04 18:17 ` Omar Sandoval
  0 siblings, 0 replies; 2+ messages in thread
From: Omar Sandoval @ 2020-03-04 18:17 UTC (permalink / raw)
  To: Yi Zhang; +Cc: linux-block, sunke32

On Thu, Feb 20, 2020 at 10:46:49PM +0800, Yi Zhang wrote:
> 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>

Thanks, applied.

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

end of thread, other threads:[~2020-03-04 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 14:46 [PATCH blktests] nbd/003: fix compiling error with gcc version 4.8.5 Yi Zhang
2020-03-04 18:17 ` Omar Sandoval

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.