Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755134AbXEYWQ4 (ORCPT ); Fri, 25 May 2007 18:16:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752605AbXEYWQu (ORCPT ); Fri, 25 May 2007 18:16:50 -0400 Received: from wr-out-0506.google.com ([64.233.184.238]:25966 "EHLO wr-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752528AbXEYWQt (ORCPT ); Fri, 25 May 2007 18:16:49 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fBHC29yym8PhVhsZiYtq/OJmXFgmQA+A2dk26xQ7GIGO2SyONUjzKKs3Xn5+ncYm2rAFWdx8UbDRV6e4aSTTlZrE1yTHrrnv+XTVHqP7eQUrEAf8vV/2NeOaj6OEXy/UVb0FCr01SWgjjJN5THb4WhEFcCTvds4h7AOdCVyPXZQ= Message-ID: Date: Sat, 26 May 2007 03:46:48 +0530 From: "Satyam Sharma" To: "H. Peter Anvin" Subject: Re: [PATCH] MIPS: Transform old-style macros to newer "__noreturn" standard. Cc: "Robert P. J. Day" , "Linux Kernel Mailing List" , "Ralf Baechle" In-Reply-To: <4657589F.7050509@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46572DAF.1000108@zytor.com> <46573B23.1090700@zytor.com> <4657589F.7050509@zytor.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1516 Lines: 42 Hi Peter, On 5/26/07, H. Peter Anvin wrote: > Robert P. J. Day wrote: > >> ... and declare functions as: > >> > >> __noreturn f(); > >> > >> ... which is the syntactially sane way of doing it. > > > > that may be, but keep in mind that gcc allows attributes to *follow* > > the parameter list as well, and some people might prefer to do the > > following: > > > > f() __noreturn; > > > > that would fail badly if you defined __noreturn as you suggest. > > That's equally moronic that saying that "some people might prefer to > write 'f() void;'", which is what it's *EXACTLY* equivalent to. Yes, > they might "prefer" it, but it's syntactically invalid and the compiler > won't accept it. As it shouldn't. > > __noreturn here takes the syntactic place of the return type, because > that's what it IS. But __attribute__((noreturn)) is simply a _function attribute_. Of course, it is legal / valid only for functions with return-type void, so it does make sense to combine both void and __attribute__((noreturn)) in the same macro like you say. But that's not syntactically necessary. In fact, grepping through the sources, a lot of people do prefer to place the attribute _after_ the function declarator. Anyway, I'm fine either way. Thanks, Satyam - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/