From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v3 3/5] xen: Identify panic and reboot/halt functions as noreturn Date: Mon, 24 Feb 2014 17:39:47 +0000 Message-ID: <530B83E3.1020603@citrix.com> References: <1393254090-5081-1-git-send-email-andrew.cooper3@citrix.com> <1393254090-5081-3-git-send-email-andrew.cooper3@citrix.com> <530B7B42020000780011EE5E@nat28.tlf.novell.com> <530B711D.2080408@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <530B711D.2080408@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Stefano Stabellini , Keir Fraser , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org 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 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 =91,=92 or =91;=92 before =91{=92 token { ^ shutdown.c:14:13: error: =91halt_this_cpu=92 used but never defined [-Werro= r] 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 ? ~Andrew