qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Add QEMU_NORETURN to some functions


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] Add QEMU_NORETURN to some functions
Date: Mon, 16 Feb 2009 20:05:12 +0100
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

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 via email to

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