This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Don't #error if including <altivec.h> without -maltivec
Your patch does not work with C++:
./altivec.h:101: error: expected init-declarator before "float"
./altivec.h:101: error: expected `,' or `;' before "float"
./altivec.h:102: error: expected init-declarator before "float"
./altivec.h:102: error: expected `,' or `;' before "float"
Ah. Right. I never use C++, so I forgot the header file is
used there as well. I'll create a new patch, if wanted.
And it only "works" with C because stuff there is implemented via
Yes. Much nicer (or not) ;-)
-maltivec just means "generate AltiVec instructions", so there
are some good uses for including the header file, but compiling
with -mno-altivec. A (more accurate) warning is fine though.
Must admit I don't follow you here. What use do you get out of
(even if it does compile) if AltiVec is not enabled?
Declarations. It's a good way to make sure that, although some source
code uses some AltiVec data types and/or PIM functions, the generated
object code will not contain any AltiVec instructions.
I actually have some code like that, and it breaks with TOT compiler.