This is the mail archive of the gcc-bugs@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]

[Bug other/58241] [PPC/Altivec] altivec.h inclusion in -std=c++98..11 causes bool to be redefined


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Francisco Jerez from comment #5)
> (In reply to Andrew Pinski from comment #3)
> > You need to use -std=g++11 or undefine bool after the include of altivec.h
> > as context sensitive keywords is not part of the C++11 standard.
> > 
> 
> Isn't the bool keyword part of the C++ standard?  I fail to see how this bug
> is invalid, the inclusion of a system header is redefining the meaning of a
> language keyword in a way that breaks standard C++ code, and the definition
> of "vector" collides with the C++ standard library.

Yes bool is a keyword fully in the C++ standard.  A system header which is
defined by the AltiVec (VMX) PIM to maybe define bool in the header.

>  Forcing the user to undef those in order to get their expected behaviour
> according to the C++ standard seems like a questionable and dangerous
> practice to me...

Since altivec.h is outside of the standard C++ land, it could do what ever it
feels like.  And If you read the PIM you will understand why this is
implemented this way.


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