]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: compilation warning fix for arm & aarch64
authorChris Patterson <pattersonc@ainfosec.com>
Wed, 27 Jul 2016 20:01:26 +0000 (16:01 -0400)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 30 May 2019 12:56:13 +0000 (13:56 +0100)
GCC 6 will warn on unused static const variables in c modules:
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00847.html

When compiling with LIBXL_HAVE_NO_SUSPEND_RESUME set (arm & aarch64),
the compiler emits the following errors:
  xl_cmdimpl.c:101:19: error: 'migrate_report'
      defined but not used [-Werror=unused-const-variable=]
  xl_cmdimpl.c:99:19: error: 'migrate_permission_to_go'
      defined but not used [-Werror=unused-const-variable=]
  xl_cmdimpl.c:97:19: error: 'migrate_receiver_ready'
      defined but not used [-Werror=unused-const-variable=]
  xl_cmdimpl.c:95:19: error: 'migrate_receiver_banner'
      defined but not used [-Werror=unused-const-variable=]

These unused const variables are only used in functions which exist between
the ifndef block:
   #ifndef LIBXL_HAVE_NO_SUSPEND_RESUME
   ...
   #endif

Wrap the same ifndef around these variables.

Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
(cherry picked from commit 5f28de0b0e474e01931b719fa27ca30b8aa446e0)

tools/libxl/xl_cmdimpl.c

index 4a1e85a48ff7929571ab3e98bb3e41f721fa22a7..662020315f6f827c110ec0fb24177f980046374a 100644 (file)
@@ -92,6 +92,7 @@ static int fd_lock = -1;
 static const char savefileheader_magic[32]=
     "Xen saved domain, xl format\n \0 \r";
 
+#ifndef LIBXL_HAVE_NO_SUSPEND_RESUME
 static const char migrate_receiver_banner[]=
     "xl migration receiver ready, send binary domain data.\n";
 static const char migrate_receiver_ready[]=
@@ -100,6 +101,8 @@ static const char migrate_permission_to_go[]=
     "domain is yours, you are cleared to unpause";
 static const char migrate_report[]=
     "my copy unpause results are as follows";
+#endif
+
   /* followed by one byte:
    *     0: everything went well, domain is running
    *            next thing is we all exit