Re: [RFC] Add support for PPC Altivec registers in gcore

Ulrich Weigand
2008-03-25T21:54:03Z

Andreas Schwab wrote:
> "Ulrich Weigand" <uweigand@de.ibm.com> writes:
>
> > What exactly seems to be the problem? The following
> > code should be valid C, and compiles fine with GCC:
>
> Your GCC is buggy.

Interesting. GCC 3.4.6 accepts it; GCC 4.1.1 does indeed
reject it with:
error: array type has incomplete element type

> > struct core_regset_section;
> > extern struct core_regset_section default_regset_sections[];
>
> The C standard does not allow this. An array declaration requires a
> complete element type.

It looks like I was indeed misremembering this. I thought an
extern declaration should be OK, as long as the declared identifier
is only ever used in contexts where it decays to a pointer ...

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com