WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] libxen compilation fixes

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxen compilation fixes
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Tue, 15 Jan 2008 18:38:31 +0000
Delivery-date: Tue, 15 Jan 2008 10:38:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <18316.59271.904412.508011@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AchXpdOFEhT56sOZEdyenwAWy6hiGQ==
Thread-topic: [Xen-devel] [PATCH] libxen compilation fixes
User-agent: Microsoft-Entourage/11.3.6.070618
-Wno-declaration-after-statement is not supported by gcc older than 3.4.
Also it should be the default behaviour anyway, even with -Wall, and libxen
throws away the passed-in CFLAGS so it will never see
-Wdeclaration-after-statement.

What would be nice would be to make libxen not throw away provided CFLAGS
and, if it's not too far gone down the declaration-after-statement route,
fix it to put its declarations at the top of blocks like a good C program.
If that's a big job though it's probably not worth the bother.

 -- Keir

On 15/1/08 17:04, "Ian Jackson" <Ian.Jackson@xxxxxxxxxxxxx> wrote:

> xen_common.h has the following function declaration:
>  extern xen_version *xen_get_client_side_version(void);
> 
> This is not a prototype and should be.  Compilers invoked with
> sensible warning options barf on declarations which do not specify the
> argument types, even for function pointers.
> 
> Also, libxen should be compiled with -Wno-declaration-after-statement
> since it uses that programming style.
> 
> Ian.
> 
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> 
> Index: xen-unstable.hg/tools/libxen/include/xen/api/xen_common.h
> ===================================================================
> --- xen-unstable.hg.orig/tools/libxen/include/xen/api/xen_common.h 2008-01-15
> 16:06:48.000000000 +0000
> +++ xen-unstable.hg/tools/libxen/include/xen/api/xen_common.h 2008-01-15
> 16:06:50.000000000 +0000
> @@ -107,7 +107,7 @@
>   * minor, and extraversion of the Xen release with which it was released,
>   * plus the library's own version as the patch.
>   */
> -extern xen_version *xen_get_client_side_version();
> +extern xen_version *xen_get_client_side_version(void);
>  
>  
>  extern bool
> Index: xen-unstable.hg/tools/libxen/Makefile
> ===================================================================
> --- xen-unstable.hg.orig/tools/libxen/Makefile 2008-01-15 16:06:48.000000000
> +0000
> +++ xen-unstable.hg/tools/libxen/Makefile 2008-01-15 16:06:50.000000000 +0000
> @@ -24,7 +24,8 @@
>  CFLAGS = -Iinclude                     \
>           $(shell xml2-config --cflags) \
>           $(shell curl-config --cflags) \
> -         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
> +         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC \
> +         -Wno-declaration-after-statement
>  
>  LDFLAGS = $(shell xml2-config --libs) \
>            $(shell curl-config --libs)
> Index: xen-unstable.hg/tools/libxen/Makefile.dist
> ===================================================================
> --- xen-unstable.hg.orig/tools/libxen/Makefile.dist 2008-01-15
> 16:06:48.000000000 +0000
> +++ xen-unstable.hg/tools/libxen/Makefile.dist 2008-01-15 16:06:50.000000000
> +0000
> @@ -22,7 +22,8 @@
>  CFLAGS = -Iinclude                     \
>           $(shell xml2-config --cflags) \
>           $(shell curl-config --cflags) \
> -         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
> +         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC \
> +         -Wno-declaration-after-statement
>  
>  LDFLAGS = $(shell xml2-config --libs) \
>            $(shell curl-config --libs)
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>