Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jan 2014 21:48:57 +0000
From:      David Chisnall <theraven@FreeBSD.org>
To:        Pedro Giffuni <pfg@FreeBSD.org>
Cc:        toolchain@FreeBSD.org
Subject:   Re: Apple's GCC 42 enhancements (was Re: [CFT] Experimental gcc update).
Message-ID:  <C6FA2135-F549-4615-AC77-3909377C8887@FreeBSD.org>
In-Reply-To: <52C5CA79.90706@FreeBSD.org>
References:  <528A924A.8050904@FreeBSD.org> <529127F8.5080606@FreeBSD.org> <3826345B-E783-43C7-B4AB-A05C95C1A8A2@FreeBSD.org> <52C5CA79.90706@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2 Jan 2014, at 20:22, Pedro Giffuni <pfg@FreeBSD.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C6FA2135-F549-4615-AC77-3909377C8887>