chkservice icon indicating copy to clipboard operation
chkservice copied to clipboard

Can't compile on Fedora 34 and newer

Open tim77 opened this issue 4 years ago • 0 comments

On Fedora 33 compiles fine, but on Fedora 34 and newer:

gmake[2]: Entering directory '/builddir/build/BUILD/chkservice-0.3/x86_64-redhat-linux-gnu'
[ 20%] Building CXX object src/CMakeFiles/CHKSYSTEMD.dir/chk-systemd.cpp.o
[ 20%] Building CXX object src/CMakeFiles/CHKSYSTEMD.dir/chk-systemd-utils.cpp.o
cd /builddir/build/BUILD/chkservice-0.3/x86_64-redhat-linux-gnu/src && /usr/bin/g++ -DCHKSYSTEMD_EXPORTS -I/builddir/build/BUILD/chkservice-0.3/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -fPIC -std=gnu++11 -MD -MT src/CMakeFiles/CHKSYSTEMD.dir/chk-systemd-utils.cpp.o -MF CMakeFiles/CHKSYSTEMD.dir/chk-systemd-utils.cpp.o.d -o CMakeFiles/CHKSYSTEMD.dir/chk-systemd-utils.cpp.o -c /builddir/build/BUILD/chkservice-0.3/src/chk-systemd-utils.cpp
cd /builddir/build/BUILD/chkservice-0.3/x86_64-redhat-linux-gnu/src && /usr/bin/g++ -DCHKSYSTEMD_EXPORTS -I/builddir/build/BUILD/chkservice-0.3/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -fPIC -std=gnu++11 -MD -MT src/CMakeFiles/CHKSYSTEMD.dir/chk-systemd.cpp.o -MF CMakeFiles/CHKSYSTEMD.dir/chk-systemd.cpp.o.d -o CMakeFiles/CHKSYSTEMD.dir/chk-systemd.cpp.o -c /builddir/build/BUILD/chkservice-0.3/src/chk-systemd.cpp
/builddir/build/BUILD/chkservice-0.3/src/chk-systemd.cpp: In member function 'const char* ChkBus::getState(const char*)':
/builddir/build/BUILD/chkservice-0.3/src/chk-systemd.cpp:120:15: error: ordered comparison of pointer with integer zero ('const char*' and 'int')
  120 |     if (state < 0) {
      |         ~~~~~~^~~
gmake[2]: *** [src/CMakeFiles/CHKSYSTEMD.dir/build.make:79: src/CMakeFiles/CHKSYSTEMD.dir/chk-systemd.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/builddir/build/BUILD/chkservice-0.3/src/chk-systemd-utils.cpp: In function 'applySYSv(char const*, char const**)':
/builddir/build/BUILD/chkservice-0.3/src/chk-systemd-utils.cpp:65:9: warning: 'status' may be used uninitialized in this function [-Wmaybe-uninitialized]
   65 |     exit(status);
      |     ~~~~^~~~~~~~
gmake[2]: Leaving directory '/builddir/build/BUILD/chkservice-0.3/x86_64-redhat-linux-gnu'
gmake[1]: Leaving directory '/builddir/build/BUILD/chkservice-0.3/x86_64-redhat-linux-gnu'
gmake[1]: *** [CMakeFiles/Makefile2:188: src/CMakeFiles/CHKSYSTEMD.dir/all] Error 2
gmake: *** [Makefile:159: all] Error 2

Full build log.

  • GCC version:
    • f33: 10.3.1-1
    • f34: 11.2.1-1
  • Cmake version:
    • f33: 3.19.7-1
    • f34: 3.20.5-1

tim77 avatar Sep 15 '21 15:09 tim77