This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/58241] [PPC/Altivec] altivec.h inclusion in -std=c++98..11 causes bool to be redefined
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 25 Aug 2013 22:44:16 +0000
- Subject: [Bug other/58241] [PPC/Altivec] altivec.h inclusion in -std=c++98..11 causes bool to be redefined
- Auto-submitted: auto-generated
- References: <bug-58241-4 at http dot gcc dot gnu dot org/bugzilla/>
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.