From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/2] Add __noreturn function attribute
Date: Thu, 04 Dec 2008 19:39:50 +0100 [thread overview]
Message-ID: <493823F6.6000407@web.de> (raw)
In-Reply-To: <4938090A.50402@siemens.com>
[-- Attachment #1: Type: text/plain, Size: 2307 bytes --]
Jan Kiszka wrote:
> Anthony Liguori wrote:
>> Jan Kiszka wrote:
>>> Thiemo Seufer wrote:
>>>
>>>> Jan Kiszka wrote:
>>>>
>>>>> Avi Kivity wrote:
>>>>>
>>>>>> Jan Kiszka wrote:
>>>>>>
>>>>>>>> Breaking the standard is what brings us the joys of recently
>>>>>>>> (re)posted
>>>>>>>> patch for NetBSD and [u]intXX fun.
>>>>>>>>
>>>>>>> I have no problem with calling it 'noreturn' instead.
>>>>>>>
>>>>>> That will break code that wants to use 'noreturn' as a local
>>>>>> variable. I think ATTR_NORETURN, while a lot uglier, is safer.
>>>>>>
>>>>> Do you have such code already? Is it exported beyond qemu scope? Then
>>>>> why not going for our own convention "'noreturn' is reserved as
>>>>> function
>>>>> attribute"? (And yes, your macro is ugly :) ).
>>>>>
>>>> "Macro names should be in upper case" is also a useful convention.
>>>>
>>> Generally yes. But there are exceptions when the macro is used in a
>>> context where upper case disturbs the readability instead of improving
>>> it. I would argue that this is the case here, but it's always a matter
>>> of taste.
>>>
>>>
>>>> FWIW, I agree with Stefan, there's currently not much need to isolate
>>>> gcc-isms.
>>>>
>>> If everyone prefers having __attribute__ in the function prototypes
>>> directly -- OK. All I want is to get rid of the warnings without
>>> changing the code into the wrong direction.
>>>
>> Please stick with the #define. It's not about the GCC-ism, it's being
>> able to quickly replace it with something else.
>
> For sure. Err... but which one now? "noreturn" is already available as
> signed patch.
...but that patch in fact has an issue with existing
__attribute__((noreturn)) sites. Converting them all to the common macro
raises the question where to put the definition. qemu-common.h appears
logical on first sight, but due to dyngen-exec.h's redefinition mess we
cannot include that header easily.
I'm currently trying to find a workaround that is not too invasive and
can quickly be removed once dyngen is gone. The deeper I dig for that,
the more weird the dependencies get.
However, please let me know if the preferred macro name is different
from "noreturn".
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
prev parent reply other threads:[~2008-12-04 18:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-28 11:47 [Qemu-devel] [PATCH 2/2] Add __noreturn function attribute Jan Kiszka
2008-11-28 17:35 ` malc
2008-11-28 17:56 ` [Qemu-devel] " Jan Kiszka
2008-11-28 18:28 ` Thiemo Seufer
2008-11-30 10:08 ` Avi Kivity
2008-11-30 11:51 ` Stefan Weil
2008-11-30 12:00 ` Laurent Desnogues
2008-11-30 12:38 ` Jan Kiszka
2008-11-30 12:52 ` Stefan Weil
2008-11-30 13:37 ` Andreas Färber
2008-11-30 17:21 ` M. Warner Losh
2008-11-30 12:33 ` Jan Kiszka
2008-11-30 13:11 ` Thiemo Seufer
2008-11-30 14:36 ` Jan Kiszka
2008-12-02 19:49 ` Anthony Liguori
2008-12-04 16:44 ` Jan Kiszka
2008-12-04 18:39 ` Jan Kiszka [this message]
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=493823F6.6000407@web.de \
--to=jan.kiszka@web.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).