[libvirt] [PATCH 4/6] Enable use of -Wmissing-noreturn

Eric Blake eblake at redhat.com
Mon Apr 4 20:42:18 UTC 2011


On 04/04/2011 10:20 AM, Daniel P. Berrange wrote:
> * src/internal.h: Define a ATTRIBUTE_NO_RETURN annotation
> * src/lxc/lxc_container.c: Annotate lxcContainerDummyChild
>   with ATTRIBUTE_NO_RETURN
> * tests/eventtest.c: Mark async thread as ATTRIBUTE_NO_RETURN
> * m4/virt-compile-warnings.m4: Enable -Wmissing-noreturn
> ---
>  m4/virt-compile-warnings.m4 |    1 -
>  src/internal.h              |    9 +++++++++
>  src/lxc/lxc_container.c     |    3 ++-
>  tests/eventtest.c           |    3 +--
>  4 files changed, 12 insertions(+), 4 deletions(-)

> 
> +++ b/src/internal.h
> @@ -117,6 +117,15 @@
>  #  endif
>  
>  /**
> + * ATTRIBUTE_NORETURN:
> + *
> + * Macro to indicate that a function won't return to the caller
> + */
> +#  ifndef ATTRIBUTE_NORETURN
> +#   define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
> +#  endif

Do we need a minimum gcc version detection, so this cause grief on older
setups?

At any rate, ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110404/3b1c8d1a/attachment-0001.sig>


More information about the libvir-list mailing list