From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for-4.6] xen/public: arm: Use __typeof__ rather than typeof Date: Fri, 23 Oct 2015 15:35:20 +0100 Message-ID: <1445610920.2374.200.camel@citrix.com> References: <1443986642-24392-1-git-send-email-julien.grall@citrix.com> <562A3295.6010901@citrix.com> <1445607059.2374.165.camel@citrix.com> <562A57D902000078000AE2A2@prv-mh.provo.novell.com> <562A3D0D.3000806@citrix.com> <562A5D4402000078000AE310@prv-mh.provo.novell.com> <1445610702.2374.199.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZpdRd-0003Ok-9k for xen-devel@lists.xenproject.org; Fri, 23 Oct 2015 14:35:49 +0000 In-Reply-To: <1445610702.2374.199.camel@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 , Julien Grall Cc: Ian Jackson , Tim Deegan , Keir Fraser , Wei.Liu2@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Fri, 2015-10-23 at 15:31 +0100, Ian Campbell wrote: > On Fri, 2015-10-23 at 08:16 -0600, Jan Beulich wrote: > > > > > On 23.10.15 at 15:58, wrote: > > > On 23/10/15 14:52, Jan Beulich wrote: > > > > > > > On 23.10.15 at 15:30, wrote: > > > > > On Fri, 2015-10-23 at 14:13 +0100, Julien Grall wrote: > > > > > > Hi, > > > > > > > > > > > > On 04/10/15 20:24, Julien Grall wrote: > > > > > > > The keyword typeof is not portable: > > > > > > > > > > > > > > /usr/src/freebsd/sys/xen/hypervisor.h:93:2: error: implicit > > > > > > > declaration > > > > > > > of function 'typeof' is invalid in C99 > > > > > > > [-Werror,-Wimplicit-function-declaration] > > > > > > > > > > > > Ping? Aside the fact that other bits of the header may not be > > > > > > iso > > > > > > compliant, I still think this patch is valid. > > > > > > > > > > Yes, I agree. > > > > > Acked-by: Ian Campbell > > > > > > > > > > Jan, after your earlier comments are you happy to go ahead with > > > > > this for > > > > > now and sort the other possible issues separately? > > > > > > > > Well - it's an improvement, sure, so I'm not intending to block it > > > > going in if no better way can be determined in its place right > > > > away. > > > > What makes me hesitant is that I'm not sure there indeed will be a > > > > follow up to this any time soon. > > > > > > TBH, having a script which check the validity of the headers is not > > > in > > > the top my todo list. Though it would be nice to have it. > > > > No, the validating script is a nice-to-have, but nothing more. What > > I was referring to was a patch to drop the use of this gcc extension. > > Then I'm confused. This patch turns a typeof into a __typeof__. In < > 56126D8702000078000A80AC@prv-mh.provo.novell.com> you said "typeof() is a > gcc extension". > > Are you now saying that __typeof__ also a gcc extension too? > > I was under the impression that __typeof__ was standard (by some cxx at > least) and your mail reinforced that (possibly wrong) impression. Hrm, it seems I was indeed wrong here and __typeof__ is just an alternative name for the gcc extension keyword which is not subject to -ansi. Ian. > > https://gcc.gnu.org/onlinedocs/gcc/Typeof.html also says that "If you are > writing a header file that must work when included in ISO C programs, > write > __typeof__ instead of typeof", which also lead me to believe __typeof__ > was > OK from this PoV. > > Ian.