qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Add QEMU_NORETURN to some functions
Date: Mon, 16 Feb 2009 20:05:12 +0100	[thread overview]
Message-ID: <4999B8E8.50509@mail.berlios.de> (raw)
In-Reply-To: <49998EBF.20006@codemonkey.ws>

Anthony Liguori schrieb:
> Stefan Weil wrote:
>> Hello,
>>
>> this patch adds the QEMU_NORETURN attribute to several functions.
>>   
>
> Based on some IRC discussion, the best place to use QEMU_NORETURN is
> in header files.  If you add it to a C file, you don't really need it
> (since the compiler can determine this anyway).
>
> Regards,
>
> Anthony Liguori


This is correct - in theory. I have put all QEMU_NORETURN in header
files were possible.

In practice, there remain two cases which are exceptions to the rule:

Without the attribute, gcc will give warnings (when they are enabled)
for static functions
which don't return. It could determine this automatically, but it does not.

And for some helper functions, there are no simple prototypes in header
files because
they are built by compiler macros, so it is difficult to add the
attribute in the header.

If we want to allow -Wmissing-noreturn some day (which is needed to see the
interesting functions), I think we have to accept these two exceptions.

Regards
Stefan Weil

  reply	other threads:[~2009-02-16 19:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13 21:44 [Qemu-devel] [PATCH] Add QEMU_NORETURN to some functions Stefan Weil
2009-02-16 15:41 ` Anthony Liguori
2009-02-16 18:10   ` Stefan Weil
     [not found]     ` <49A9673D.8000805@mail.berlios.de>
     [not found]       ` <49A9B0C4.3090606@us.ibm.com>
     [not found]         ` <49A9B7A0.7030606@mail.berlios.de>
     [not found]           ` <49AB1BC8.2060309@us.ibm.com>
     [not found]             ` <49AB953B.2050802@mail.berlios.de>
     [not found]               ` <49ABEAF6.10502@us.ibm.com>
2009-03-02 15:11                 ` Stefan Weil
2009-02-16 16:05 ` Anthony Liguori
2009-02-16 19:05   ` Stefan Weil [this message]
2009-02-17  0:34     ` Jamie Lokier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4999B8E8.50509@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).