If I have a code like: #include<altivec.h> int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);} It compiled gcc-9 (g++ -std=c++11 code.c), but fails with gcc-10 (without "-std=c++11" gcc-10 will compile the code fine as well). What is wrong here?
Does using -std=gnu++11 work?
(In reply to Andrew Pinski from comment #1) > Does using -std=gnu++11 work? It does indeed!
altivec.h is clear: /* If __APPLE_ALTIVEC__ is defined, the compiler supports 'vector', 'pixel' and 'bool' as context-sensitive AltiVec keywords (in non-AltiVec contexts, they revert to their original meanings, if any), so we do not need to define them as macros. Also, avoid defining them as macros for C++ with strict ANSI, as this is not compatible. */ #if !defined(__APPLE_ALTIVEC__) \ && (!defined(__STRICT_ANSI__) || !defined(__cplusplus)) #define vector __vector #define pixel __pixel #define bool __bool #endif You can't use the non-standard 'vector' extension if you request strict c++11 mode.