linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>, David Ahern <dsahern@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [RFC] perf: perf_event_attr anon unions and static initializer issue
Date: Fri, 5 Oct 2012 13:49:44 +0200	[thread overview]
Message-ID: <CABPqkBTjwEp+wO_PW6xtazYiZXA-ogsmKVOd2-JJgbh47sHcQA@mail.gmail.com> (raw)
In-Reply-To: <1349434879.14388.35.camel@twins>

On Fri, Oct 5, 2012 at 1:01 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, 2012-10-05 at 12:36 +0200, Stephane Eranian wrote:
>
>> struct perf_event_attr attr = { .config = 0x1234, .config1 = 0x456 };
>
>> Does anyone have a better solution to propose?
>
>
>   struct perf_event_attr attr = {
>         .config = 0x1234,
>         { .config1 = 0x5678 },
>   };
>
> sometimes works, but apparently not in this case.. its a bit unfortunate
> indeed. EDG based compilers and the latest C std use your version --
> hence also 4.6 supporting it.
>
> Yeah, I'm afraid we're stuck with this until a future where modern C
> isn't modern anymore.

Yeah, unfortunately.
I ended up creating a separate table for config1 and initializing attr.config1
at runtime. That way it works regardless of the compiler....

  reply	other threads:[~2012-10-05 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 10:36 [RFC] perf: perf_event_attr anon unions and static initializer issue Stephane Eranian
2012-10-05 11:01 ` Peter Zijlstra
2012-10-05 11:49   ` Stephane Eranian [this message]
2012-10-05 12:43     ` Borislav Petkov

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=CABPqkBTjwEp+wO_PW6xtazYiZXA-ogsmKVOd2-JJgbh47sHcQA@mail.gmail.com \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).