Whamcloud - gitweb
LU-11855 utils: move declarations out of local blocks 26/34026/6 pcc
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 5 Feb 2019 16:45:19 +0000 (19:45 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 8 Mar 2019 21:49:52 +0000 (21:49 +0000)
few variables were declared within local blocks, but used by
pointer when blocks are closed. this schema used to work with
older GCC (due to trivial stack management), but not with GCC8.

Change-Id: Ibd02a72264d50609ccf3c5bc5252e45de4160b9e
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34026
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/obd.c

index 8435d2f..a9e91d8 100644 (file)
@@ -2996,6 +2996,7 @@ int jt_llog_check(int argc, char **argv)
 {
         struct obd_ioctl_data data;
         char rawbuf[MAX_IOC_BUFLEN], *buf = rawbuf;
+       char from[2] = "1", to[3] = "-1";
         int rc;
 
         if (argc != 2 && argc != 4)
@@ -3011,7 +3012,6 @@ int jt_llog_check(int argc, char **argv)
                 data.ioc_inllen3 = strlen(argv[3]) + 1;
                 data.ioc_inlbuf3 = argv[3];
         } else {
-                char from[2] = "1", to[3] = "-1";
                 data.ioc_inllen2 = strlen(from) + 1;
                 data.ioc_inlbuf2 = from;
                 data.ioc_inllen3 = strlen(to) + 1;