All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Jan Kiszka" <jan.kiszka@siemens.com>,
	patches@linaro.org,
	"Dr. David Alan Gilbert" <david.gilbert@linaro.org>,
	"Andreas Färber" <afaerber@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 1/3] qemu-tls.h: Add abstraction layer for TLS variables
Date: Thu, 27 Oct 2011 17:18:46 +0200	[thread overview]
Message-ID: <4EA97656.6000609@redhat.com> (raw)
In-Reply-To: <CAFEAcA-1N-6xDOYemWzGsSxX5fvSbX4U7-yeMpGUMhnbO29dSQ@mail.gmail.com>

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

  reply	other threads:[~2011-10-27 15:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 11:37 [Qemu-devel] [PATCH v2 0/3] TLS abstraction layer for thread-local cpu_single_env on Linux Peter Maydell
2011-10-27 11:37 ` [Qemu-devel] [PATCH v2 1/3] qemu-tls.h: Add abstraction layer for TLS variables Peter Maydell
2011-10-27 15:04   ` Andreas Färber
2011-10-27 15:08     ` Paolo Bonzini
2011-10-27 15:15     ` Peter Maydell
2011-10-27 15:18       ` Paolo Bonzini [this message]
2011-10-27 16:18     ` Andreas Färber
2011-10-28  7:27     ` Markus Armbruster
2011-10-28  7:45       ` Peter Maydell
2011-10-27 11:37 ` [Qemu-devel] [PATCH v2 2/3] darwin-user/main.c: Drop unused cpu_single_env definition Peter Maydell
2011-10-27 13:22   ` Andreas Färber
2011-10-27 11:37 ` [Qemu-devel] [PATCH v2 3/3] Make cpu_single_env thread-local Peter Maydell
2011-10-27 15:10   ` Andreas Färber
2011-10-27 15:12     ` Paolo Bonzini
2011-10-27 16:20     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA97656.6000609@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=david.gilbert@linaro.org \
    --cc=jan.kiszka@siemens.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.