Bug 1419687
Summary: | possible compiler error - mame does not build with gcc-7 | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Julian Sikorski <belegdol> | ||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | rawhide | CC: | davejohansen, jakub, jwakely, law, mpolacek | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | 7.0.1-0.8.fc26 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2017-02-14 06:37:51 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Julian Sikorski
2017-02-06 18:37:02 UTC
File triggerring the error: https://github.com/mamedev/mame/blob/22c42abfdf438781183c9a18486a38fe35946305/src/devices/bus/sunkbd/hlekbd.cpp Upstream argumentation: - hle_device_base has a protected constructor - this is accessible by all directly derived classes, that's the point of protected members - hle_type4_device_base derives from hle_device_base inherits the constructor with a using statement in its protected section, making it accessible to derived classes - hle_type4_device_base has no data members without default constructors to prevent the inherited constructor from being used (it has no data members at all) - The concrete Type 4/5 device classes derive from hle_type4_device_base and call its inherited constructor from their public constructors - Initialisation of bases/members is in class scope, so protected members of bases are accessible Can you please attach preprocessed source? The build fails for me with: + RPM_OPT_FLAGS='-O2 -g1 -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 -mtune=generic' + /usr/bin/make -O -j24 NOWERROR=1 OPTIMIZE=2 VERBOSE=1 USE_SYSTEM_LIB_EXPAT=1 USE_SYSTEM_LIB_ZLIB=1 USE_SYSTEM_LIB_JPEG=1 USE_SYSTEM_LIB_FLAC=1 USE_SYSTEM_LIB_LUA=1 USE_SYSTEM_LIB_SQLITE3=1 USE_SYSTEM_LIB_PORTMIDI=1 USE_SYSTEM_LIB_PORTAUDIO=1 USE_SYSTEM_LIB_UTF8PROC=1 'SDL_INI_PATH=/etc/mame;' TOOLS=1 'OPT_FLAGS=-O2 -g1 -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 -mtune=generic' 'LDOPTS=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' GCC 7 detected makefile:939: *** Python is not available in path. Stop. error: Bad exit status from /var/tmp/rpm-tmp.KXtmhK (%build) Bad exit status from /var/tmp/rpm-tmp.KXtmhK (%build) (both with gcc7 and 6). Created attachment 1248208 [details]
hlekbd.ii for gcc7 (f26)
I reduced the number of components built to save some compilation time, the error now is:
Compiling src/devices/bus/sunkbd/hlekbd.cpp...
g++ -MMD -MP -MP -DPTR64=1 -DNDEBUG -DCRLF=2 -DLSB_FIRST -DXMD_H -DFLAC__NO_DLL -DNATIVE_DRC=drcbe_x64 -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -I../../../../../src/osd -I../../../../../src/emu -I../../../../../src/devices -I../../../../../src/lib/netlist -I../../../../../src/mame -I../../../../../src/lib -I../../../../../src/lib/util -I../../../../../3rdparty -I../../../../generated/emu -I../../../../generated/emu/layout -I../../../../../scripts -I../../../../../3rdparty/asio/include -m64 -pipe -Wno-deprecated-declarations -O2 -fno-strict-aliasing -O2 -g1 -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 -mtune=generic -save-temps -Wno-unknown-pragmas -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -Wno-unused-result -Wno-array-bounds -m64 -x c++ -std=c++14 -Woverloaded-virtual -Wsuggest-override -flifetime-dse=1 -o "../../../../linux_gcc/obj/x64/Release/src/devices/bus/sunkbd/hlekbd.o" -c "../../../../../src/devices/bus/sunkbd/hlekbd.cpp"
g++: warning: -pipe ignored because -save-temps specified
../../../../../src/devices/bus/sunkbd/hlekbd.cpp: In constructor 'bus::sunkbd::hle_type4_device::hle_type4_device(const machine_config&, const char*, device_t*, uint32_t)':
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:1140:54: error: 'bus::sunkbd::hle_device_base::hle_device_base(const machine_config&, device_type, const char*, const char*, device_t*, uint32_t, const char*, const char*)' is protected within this context
__FILE__)
^
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:752:1: note: declared protected here
hle_device_base::hle_device_base(
^~~~~~~~~~~~~~~
../../../../../src/devices/bus/sunkbd/hlekbd.cpp: In constructor 'bus::sunkbd::hle_type5_device::hle_type5_device(const machine_config&, const char*, device_t*, uint32_t)':
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:1179:54: error: 'bus::sunkbd::hle_device_base::hle_device_base(const machine_config&, device_type, const char*, const char*, device_t*, uint32_t, const char*, const char*)' is protected within this context
__FILE__)
^
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:752:1: note: declared protected here
hle_device_base::hle_device_base(
^~~~~~~~~~~~~~~
../../../../../src/devices/bus/sunkbd/hlekbd.cpp: In constructor 'bus::sunkbd::hle_type5_gb_device::hle_type5_gb_device(const machine_config&, const char*, device_t*, uint32_t)':
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:1218:54: error: 'bus::sunkbd::hle_device_base::hle_device_base(const machine_config&, device_type, const char*, const char*, device_t*, uint32_t, const char*, const char*)' is protected within this context
__FILE__)
^
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:752:1: note: declared protected here
hle_device_base::hle_device_base(
^~~~~~~~~~~~~~~
../../../../../src/devices/bus/sunkbd/hlekbd.cpp: In constructor 'bus::sunkbd::hle_type5_se_device::hle_type5_se_device(const machine_config&, const char*, device_t*, uint32_t)':
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:1257:54: error: 'bus::sunkbd::hle_device_base::hle_device_base(const machine_config&, device_type, const char*, const char*, device_t*, uint32_t, const char*, const char*)' is protected within this context
__FILE__)
^
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:752:1: note: declared protected here
hle_device_base::hle_device_base(
^~~~~~~~~~~~~~~
../../../../../src/devices/bus/sunkbd/hlekbd.cpp: In constructor 'bus::sunkbd::hle_type5_jp_device::hle_type5_jp_device(const machine_config&, const char*, device_t*, uint32_t)':
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:1296:54: error: 'bus::sunkbd::hle_device_base::hle_device_base(const machine_config&, device_type, const char*, const char*, device_t*, uint32_t, const char*, const char*)' is protected within this context
__FILE__)
^
../../../../../src/devices/bus/sunkbd/hlekbd.cpp:752:1: note: declared protected here
hle_device_base::hle_device_base(
^~~~~~~~~~~~~~~
make[2]: *** [optional.make:973: ../../../../linux_gcc/obj/x64/Release/src/devices/bus/sunkbd/hlekbd.o] Error 1
This compiles fine with -fno-new-inheriting-ctors, the errors started appearing when -fnew-inheriting-ctors has been added and made default ( http://gcc.gnu.org/r241765 ). Is the mame code wrong then? Upstream argue they are doing nothing illegal as per comment 2. I don't know, will have to ask our C++ people. In the mean time, I've reduced it to: class B { protected: B (int, int); }; class C : public B { protected: using B::B; }; class A : public C { A (char *); }; A::A (char *) : C (0, 0) { } which still fails with -fnew-inheriting-ctors (aka http://wg21.link/p0136 , because being a DR applying to older C++ releases too) and succeeds with -fno-new-inheriting-ctors. With 7.0.1-0.8.fc26 mame builds fine, thank you for taking care of this. |