altivec.h add parentheses

Jason Merrill jason@redhat.com
Sat Feb 23 12:25:00 GMT 2002


>>>>> "Aldy" == Aldy Hernandez <aldyh@redhat.com> writes:

> consider this:
> 	#define foo() (vector int) blah

> 	hotdog = (vector short)foo();

> this gets expanded into:

> hotdog = (__attribute__ ((vector_size(16))) short) (__attribute__ ((vector_size(16))) int) blah;

> both attributes in a row cause parse errors at times.  i'm pretty sure
> this is a parsing bug, i'm too lazy to debug it now.  

If this is with my vector literal patch applied, the Altivec spec gives
its blessing to this particular parsing bug...:)

> for now, i'm adding an extra level of parentheses to all altivec functions
> returning casted values... which can't hurt at all.

I don't know if this would fix the problem, but you should really adjust
the altivec.h macros so that all uses of the macro parameters are wrapped
in parens.

Jason



More information about the Gcc-patches mailing list