This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More altivec array initialisation troubles


>> Try casting each of the vector initialiser to vectors
>>
>> {
>> 	{(vector signed short){1, 2, 3, 4, 5, 6, 7, 8}},
>> 	{(vector signed short){11, 12, 13, 14, 15, 16, 17, 18}},
>> ;	...
>> }

the extra {}'s make no sense.  think about it.  this is an
array of vectors, so you should have 4 elements like you do
below:
>

> static const vector signed short test4[4] =
> {
>     (vector signed short){1, 2, 3, 4, 5, 6, 7, 8},
>     (vector signed short){11, 12, 13, 14, 15, 16, 17, 18},
>     (vector signed short){21, 22, 23, 24, 25, 26, 27, 28},
>     (vector signed short){31, 32, 33, 34, 35, 36, 37, 38}
> };
>
> does. This should be fixed anyhow as it's fairly simple to get wrong
> and the warning is sort of confusing, not to mention that the
> behaviour is not really sensible (at least to me).

perhaps errors should be more sane though.

aldy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]