This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't #error if including <altivec.h> without -maltivec
- From: Ziemowit Laski <zlaski at apple dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 23 Mar 2004 12:53:03 -0800
- Subject: Re: [PATCH] Don't #error if including <altivec.h> without -maltivec
- References: <ACFC5290-7CA2-11D8-A085-000A95A4DC02@kernel.crashing.org>
Segher,
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"
:
And it only "works" with C because stuff there is implemented via
macros. :-)
The -maltivec flag enables the use of 'vector ...' types in source code,
which of course appear prominently in <altivec.h>.
-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
<altivec.h>
(even if it does compile) if AltiVec is not enabled?
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477