Bug 1394505 - Weird error with bool only on powerpc
Summary: Weird error with bool only on powerpc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-12 18:59 UTC by Dennis Payne
Modified: 2017-03-01 21:31 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-03-01 21:31:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dennis Payne 2016-11-12 18:59:18 UTC
Description of problem:
When building bt builder on power pc, fedora's build system is giving the following error:

g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mcpu=power8 -mtune=power8 -DSDL2LIB -D_REENTRANT -I/usr/include/SDL2 -Isrc/ --std=c++11 -DBTBUILDERDIR=/usr/share/btbuilder -c -o src/monster.o src/monster.C
In file included from src/display.h:10:0,
                 from src/monster.h:15,
                 from src/monster.C:8:
ssrc/psuedo3d.h:18:129: error: could not convert 'true' from 'bool' to '__vector(4) __bool int'
   virtual void loadImageOrAnimation(const char *file, SDL_Surface **img, MNG_Image **animation, bool imageWindow, bool physfs = true) = 0;
                                                                                                                                 ^~~~

It compile fine on x86 and arm. I've been told it can be fixed by using --std=gnu++11 instead of --std=c++11. I think this is probably an error in gcc. If I'm doing something wrong please let me know.


How reproducible:
Build the btbuilder source rpm on power pc platform.

Comment 1 Fedora End Of Life 2017-02-28 10:36:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Jakub Jelinek 2017-03-01 21:31:47 UTC
If you build with -std=c++11 (or any other strict ISO mode) and include altivec.h, that is to be expected, altivec.h redefines bool and vector for the Altivec purposes, so if you want to use it in C++ code, you need to include altivec.h after all STL headers and if you want to use bool/vector the way it is used normally in C++, you need to #undef them afterwards.  In -std=gnu++11 and other GNU modes GCC uses conditional preprocessor macros that act as the Altivec macros in certain contexts and as normal C++ bool/vector in other contexts.


Note You need to log in before you can comment on or make changes to this bug.