Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475090

Re: [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
Date 2016-09-02 14:20 +0200
Message-ID <scVBT-7O6-13@gated-at.bofh.it> (permalink)
References <scTgJ-6aO-5@gated-at.bofh.it> <scUmu-6SO-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, 2 Sep 2016, Sebastian Andrzej Siewior wrote:
> On 2016-09-02 17:42:33 [+0800], kbuild test robot wrote:
> > compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
> > 
> > >> kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
> > >> kernel/cpu.c:1252:3: warning: missing braces around initializer
> >    kernel/cpu.c:1252:3: warning: (near initialization for 'cpuhp_bp_states[0].<anonymous>')
> > >> kernel/cpu.c:1253:3: error: unknown field 'teardown' specified in initializer
> >    kernel/cpu.c:1425:3: error: unknown field 'startup' specified in initializer
> >    kernel/cpu.c:1425:3: warning: missing braces around initializer
> >    kernel/cpu.c:1425:3: warning: (near initialization for 'cpuhp_ap_states[121].<anonymous>')
> >    kernel/cpu.c:1426:3: error: unknown field 'teardown' specified in initializer
> 
> This is a compiler issue. We have:
> | struct cpuhp_step {
> |         const char              *name;
> |         union {
> |                 int             (*startup)(unsigned int cpu);
> |                 int             (*startup_multi)(unsigned int cpu,
> |                                                  void *node);
> |         };
> …
> | };
> This unnamed union fields are valid as of ISO C11.
> It seems that gcc 4.5 and earlier can't access ->startup. According to
> [0] this is supported since gcc 4.6.
> 
> [0] https://gcc.gnu.org/wiki/C11Status

And we have anon unions in other places as well. See
include/linux/spinlock_types.h

Thanks

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field  'startup' specified in initializer kbuild test robot <fengguang.wu@intel.com> - 2016-09-02 11:50 +0200
  Re: [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field  'startup' specified in initializer Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-09-02 13:00 +0200
    Re: [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field  'startup' specified in initializer Thomas Gleixner <tglx@linutronix.de> - 2016-09-02 14:20 +0200

csiph-web