From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJRjM-00070P-1P for qemu-devel@nongnu.org; Thu, 27 Oct 2011 11:18:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJRjH-0004SB-Qu for qemu-devel@nongnu.org; Thu, 27 Oct 2011 11:18:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJRjH-0004Rj-HU for qemu-devel@nongnu.org; Thu, 27 Oct 2011 11:18:51 -0400 Message-ID: <4EA97656.6000609@redhat.com> Date: Thu, 27 Oct 2011 17:18:46 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1319715472-16286-1-git-send-email-peter.maydell@linaro.org> <1319715472-16286-2-git-send-email-peter.maydell@linaro.org> <4EA97304.9080500@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/3] qemu-tls.h: Add abstraction layer for TLS variables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Jan Kiszka , patches@linaro.org, "Dr. David Alan Gilbert" , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , qemu-devel@nongnu.org On 10/27/2011 05:15 PM, Peter Maydell wrote: > >>> >> +#define DEFINE_TLS(type, x) __thread __typeof__(type) tls__##x >> > I assume __typeof__() is a GCCism, indicated by ..._GCC_H, to ensure >> > type is actually a valid type? > Paolo? No, _GCC_H has nothing to do with GCCisms. __typeof__ is needed so that "type" can be "int[5]": __thread __typeof__ (int[5]) foo; /* works */ __thread int[5] foo; /* fails */ (even without __thread of course). In fact, it has the opposite side effect: type can be any expression, but the assumption is that DEFINE_TLS(123, x) will be caught by review. Paolo