Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8 unix fails to build with gcc 8.0.1 (fedora 29, rawhide) #10

Open
rosset opened this issue Apr 14, 2018 · 8 comments
Open

1.8 unix fails to build with gcc 8.0.1 (fedora 29, rawhide) #10

rosset opened this issue Apr 14, 2018 · 8 comments

Comments

@rosset
Copy link

rosset commented Apr 14, 2018

Making all in src
/usr/bin/make all-am
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o output.o output.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o alsa.o alsa.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o disk.o disk.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o ao.o ao.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
adplay.cc:115:1: error: narrowing conversion of '4294967295' from 'unsigned int' to 'int' inside { } [-Wnarrowing]
};
^
make[2]: *** [Makefile:497: adplay.o] Error 1
make[2]: Entering directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libbinio -DADPLUG_DATA_DIR="/var/lib/adplug" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o adplay.o adplay.cc
make[2]: Leaving directory '/home/filiperosset/rpmbuild/my/failed/adplay/adplay-1.8/src'
make[1]: *** [Makefile:351: all] Error 2
make: *** [Makefile:404: all-recursive] Error 1
erro: Status de saída de /var/tmp/rpm-tmp.YWr9Yj inválido (%build)
Status de saída de /var/tmp/rpm-tmp.YWr9Yj inválido (%build)

Erros na construção do RPM:
Could not execute local: rpmbuild --define '_sourcedir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_specdir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_builddir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_srcrpmdir /home/filiperosset/rpmbuild/my/failed/adplay' --define '_rpmdir /home/filiperosset/rpmbuild/my/failed/adplay' --define 'dist .fc29' --define 'fedora 29' --eval '%undefine rhel' --define 'fc29 1' -ba /home/filiperosset/rpmbuild/my/failed/adplay/adplay.spec | tee .build-1.8-1.fc29.log
[filiperosset@raw adplay]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.0.1 20180410 (Red Hat 8.0.1-0.21) (GCC)

@Malvineous
Copy link
Member

Don't really understand this error. It's complaining that an unsigned int is being assigned a value of (unsigned int)-1 which is allowed. The complaint is that it's being converted to int but it's not. The typecast should avoid the error, unless this is some new 32-bit vs 64-bit error?

Maybe this is a bug in GCC?

@ildar
Copy link

ildar commented Apr 15, 2018 via email

@Malvineous
Copy link
Member

It's not really max uint, it's more a magic number that's very unlikely to be used. It would be a shame if (unsigned int)-1 no longer works, because IMHO that's clearer than something like UINT_MAX, which suggests you want a really large number for some reason.

@ildar
Copy link

ildar commented Apr 24, 2018 via email

@rosset
Copy link
Author

rosset commented Apr 25, 2018

reverting this commit fix the issue with gcc8

48dcaa8

@Malvineous
Copy link
Member

@ildar Not against the guidelines, I just think that readable code is more important than following someone else's rules. Now that I think about it, it would be even better to do something like #define SUBSONG_NONE xxx so if someone wants to submit a patch for that I will happily apply it.

@rosset Thanks for finding the breaking commit. Looks like we can't remove the cast or a compiler warning will return with GCC < 8, so using a #define along with ildar's suggestion of UINT_MAX or similar is probably the way to go.

@mywave82
Copy link
Contributor

The magic number ~0 is all bits set

@mywave82
Copy link
Contributor

(the reason the compilation fails is due to -Werror, causing all warnings to be become errors)

@Malvineous, you decide if you want to change the code or not, and close this issue as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants