From owner-svn-src-user@FreeBSD.ORG Thu Jun 3 11:22:29 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DF9D1065675; Thu, 3 Jun 2010 11:22:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 0846C8FC25; Thu, 3 Jun 2010 11:22:28 +0000 (UTC) Received: from c122-106-160-243.carlnfd1.nsw.optusnet.com.au (c122-106-160-243.carlnfd1.nsw.optusnet.com.au [122.106.160.243]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o53BMObX023897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Jun 2010 21:22:26 +1000 Date: Thu, 3 Jun 2010 21:22:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Juli Mallett In-Reply-To: <201006021108.o52B8udH036012@svn.freebsd.org> Message-ID: <20100603205323.P27876@delplex.bde.org> References: <201006021108.o52B8udH036012@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r208738 - user/jmallett/octeon/sys/contrib/octeon-sdk X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 11:22:29 -0000 > Log: > Spell typeof in the preferred way for the FreeBSD kernel. Thanks, but that way is __typeof... > Modified: user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-asm.h > ============================================================================== > --- user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-asm.h Wed Jun 2 11:06:03 2010 (r208737) > +++ user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-asm.h Wed Jun 2 11:08:56 2010 (r208738) > @@ -225,12 +225,12 @@ extern "C" { > unsigned long _v; \ > ASM_STMT ("rdhwr\t%0,$31\n" \ > "\tsll\t%0,%0,0" : "=d"(_v)); \ > - result = (typeof(result))_v; \ > + result = (__typeof__(result))_v; \ > } \ ... typeof is not just an unpreferred spelling, but a syntax error (if compiled by a C compiler or by gcc -pedantic), while __typeof__ is a just an unpreferred (gnuish) spelling. > } else { \ > unsigned long _v; \ > ASM_STMT ("rdhwr\t%0,$" CVMX_TMP_STR(regstr) : "=d"(_v)); \ > - result = (typeof(result))_v; \ > + result = (__typeof__(result))_v; \ > }}) More syntax errors. Careful code uses __extension__. Here the excessive underscores must be used because the gnuish spelling for __extension__ is not aliased to a good spelling. 27 lines in RELENG_9 use some form of typeof, and 10 of them actually have the preferred spelling, with the unpreferred one mainly in newer non-core code: xfs: 6 lines with typeof, but 2 of these #define typeof as __typeof if typeof is not defined, which should be always reiserfs: 2 lines with __typeof__ drm: 4 lines with __typeof nxge: 1 line with __typeof net: 1 line with __typeof i386/include: 1 line with _typeof by me; 2 lines with __typeof__ (xen) xen: 5 lines with typeof amd64/include: 1 line with _typeof by me; 2 lines with __typeof__ (xen) sys: 2 lines with __typeof Bruce