From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 2 22:11:07 2014 Return-Path: Delivered-To: toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70692D01; Thu, 2 Jan 2014 22:11:07 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E13218B5; Thu, 2 Jan 2014 22:11:03 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id s02Ln2ea014273 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 2 Jan 2014 21:49:04 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: Apple's GCC 42 enhancements (was Re: [CFT] Experimental gcc update). From: David Chisnall In-Reply-To: <52C5CA79.90706@FreeBSD.org> Date: Thu, 2 Jan 2014 21:48:57 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <528A924A.8050904@FreeBSD.org> <529127F8.5080606@FreeBSD.org> <3826345B-E783-43C7-B4AB-A05C95C1A8A2@FreeBSD.org> <52C5CA79.90706@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1822) Cc: toolchain@FreeBSD.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jan 2014 22:11:07 -0000 On 2 Jan 2014, at 20:22, Pedro Giffuni wrote: > The behaviour is consistent with llvm-gcc though, as explained here: >=20 > https://bugs.launchpad.net/ubuntu/+source/llvm-gcc-4.2/+bug/483679 >=20 > " looking at the LLVM/Clang documentation = (http://clang.llvm.org/doxygen/InitPreprocessor_8cpp-source.html) shows = that __block is not actually a keyword, but a macro that is defined to = be __attribute__((__blocks__(byref)))." >=20 > Not sure what to do about it, I had added a #define for it in Block.h = since you have to link with -lBlocksRuntime anyways, but not everything = includes Block.h (surely not the libdispatch tests). Probably the best solution is to put this in cdefs.h: #if defined(__BLOCKS__) && !defined(__block) # define __block __attribute__((__blocks__(byref))) #endif (With the indentation changed to make it harder to read, as per = style(9)). I believe __BLOCKS__ is supported by clang, although testing = for it is discouraged in favour of the __has_{feature,extension} = mechanism. =20 David