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

Re: [Xen-devel] [PATCH v3 3/5] xen: Identify panic and reboot/halt functions as noreturn

On 24/02/14 16:19, Andrew Cooper wrote:
> On 24/02/14 16:02, Jan Beulich wrote:
>>>>> On 24.02.14 at 16:01, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> This patch shows a somewhat undesirable inconsistency (having been
>> present in I think les obvious ways in earlier patches too):
>>> --- a/xen/arch/arm/shutdown.c
>>> +++ b/xen/arch/arm/shutdown.c
>>> @@ -11,7 +11,7 @@ static void raw_machine_reset(void)
>>>      platform_reset();
>>>  }
>>> -static void halt_this_cpu(void *arg)
>>> +static void noreturn halt_this_cpu(void *arg)
>> For function definitions you place the attribute where I personally
>> would expect it to be (iirc it can't go between the closing paren
>> after the parameter declarations and the opening brace of the
>> function body), yet ...
> Hmm - I thought I had fixed all of these - I shall audit and respin.  I
> certainly did intend to be consistent.
> ~Andrew

And now I remember why it is strictly this way around.

It is a compile error to have the noreturn after the arguments on a
static function.

shutdown.c:15:1: error: expected ‘,’ or ‘;’ before ‘{’ token
shutdown.c:14:13: error: ‘halt_this_cpu’ used but never defined [-Werror]
static void halt_this_cpu(void *arg) noreturn

but fine to have the attributes between the return type and name.

I could standardise on the other way around, to be the same as __init &
friends ?


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.