xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxl: compilation warning fix for arm & aarch64
@ 2016-07-27 20:01 Chris Patterson
  2016-07-28 10:09 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Patterson @ 2016-07-27 20:01 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, Chris Patterson, wei.liu2

From: Chris Patterson <pattersonc@ainfosec.com>

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>
---
 tools/libxl/xl_cmdimpl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d1fcfa4..ada8178 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -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
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] libxl: compilation warning fix for arm & aarch64
  2016-07-27 20:01 [PATCH] libxl: compilation warning fix for arm & aarch64 Chris Patterson
@ 2016-07-28 10:09 ` Wei Liu
  2016-08-01 10:25   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2016-07-28 10:09 UTC (permalink / raw)
  To: Chris Patterson; +Cc: ian.jackson, Chris Patterson, wei.liu2, xen-devel

On Wed, Jul 27, 2016 at 04:01:26PM -0400, Chris Patterson wrote:
> From: Chris Patterson <pattersonc@ainfosec.com>
> 
> 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>

> ---
>  tools/libxl/xl_cmdimpl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index d1fcfa4..ada8178 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -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
> -- 
> 2.1.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] libxl: compilation warning fix for arm & aarch64
  2016-07-28 10:09 ` Wei Liu
@ 2016-08-01 10:25   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2016-08-01 10:25 UTC (permalink / raw)
  To: Chris Patterson; +Cc: ian.jackson, Chris Patterson, wei.liu2, xen-devel

On Thu, Jul 28, 2016 at 11:09:41AM +0100, Wei Liu wrote:
> On Wed, Jul 27, 2016 at 04:01:26PM -0400, Chris Patterson wrote:
> > From: Chris Patterson <pattersonc@ainfosec.com>
> > 
> > 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>
> 

Pushed.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-08-01 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-27 20:01 [PATCH] libxl: compilation warning fix for arm & aarch64 Chris Patterson
2016-07-28 10:09 ` Wei Liu
2016-08-01 10:25   ` Wei Liu

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 NNTP newsgroup(s).