qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities
Date: Mon, 16 Jul 2012 09:35:36 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 07/15/2012 07:54 AM, Stefan Weil wrote:
> Since commit 417c9d72d48275d19c60861896efd4962d21aca2 all configure tests
> normally run with -Werror. Some of these tests now fail because they
> raised a compiler warning.
> 
> This patch fixes support for capabilities.
> 
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>  configure |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index f745cc2..abde4c0 100755
> --- a/configure
> +++ b/configure
> @@ -2082,7 +2082,7 @@ if test "$cap" != "no" ; then
>    cat > $TMPC <<EOF
>  #include <stdio.h>
>  #include <sys/capability.h>
> -int main(void) { cap_t caps; caps = cap_init(); }
> +int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; }

Nothing wrong with this patch, per se, but in the Autoconf world, the
general advice is that programs should check whether -Werror is
supported, but then avoid using it for the entire remainder of the
configure script (that is, store the result of -Werror into a different
variable that gets added into the final CFLAGS at make time, but not
used during any of the rest of the configure time).  That's because it's
just too hard to avoid warnings-turned-into-errors for all possible
versions (including future releases) of gcc, so you are just too likely
to run into spurious changes in configurations when the next version of
gcc starts warning about something new if you try to run all your
configure tests with -Werror.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]