procenv icon indicating copy to clipboard operation
procenv copied to clipboard

build failure with -Werror

Open loveshack opened this issue 4 months ago • 0 comments

The Fedora rawhide build of procenv 0.60 is failing. It uses gcc-15.2 and sets -Werror. The errors, which I've worked around in the packaging, are

gcc -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform  -I ./platform/linux -D PROCENV_PLATFORM_LINUX       -DHAVE_SELINUX   -pedantic -std=gnu99 -Wall -Wunused  -fdata-sections -ffunction-sections -Werror -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -fstack-protector -Wformat -Wformat-security -c -o procenv-procenv.o `test -f 'procenv.c' || echo './'`procenv.c
make[2]: Leaving directory '/builddir/build/BUILD/procenv-0.60-build/procenv-0.60/src'
procenv.c: In function ‘show_stat’:
procenv.c:1882:9: error: the comparison will always evaluate as ‘true’ for the address of ‘cwd’ will never be NULL [-Werror=address]
 1882 |         assert (misc.cwd);
      |         ^~~~~~
In file included from util.h:41,
                 from procenv.h:85,
                 from procenv.c:15:
platform.h:91:16: note: ‘cwd’ declared here
   91 |         char   cwd[PATH_MAX];
      |                ^~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:690: procenv-procenv.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory '/builddir/build/BUILD/procenv-0.60-build/procenv-0.60/src'
gcc -DHAVE_CONFIG_H -I. -I..  -I . -I ./platform  -I ./platform/linux -D PROCENV_PLATFORM_LINUX       -DHAVE_SELINUX   -pedantic -std=gnu99 -Wall -Wunused  -fdata-sections -ffunction-sections -Werror -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -fstack-protector -Wformat -Wformat-security -c -o platform/linux/procenv-platform.o `test -f 'platform/linux/platform.c' || echo './'`platform/linux/platform.c
make[2]: Leaving directory '/builddir/build/BUILD/procenv-0.60-build/procenv-0.60/src'
platform/linux/platform.c: In function ‘linux_kernel_version’:
platform/linux/platform.c:1949:9: error: the comparison will always evaluate as ‘true’ for the address of ‘release’ will never be NULL [-Werror=address]
 1949 |         assert (uts.release);
      |         ^~~~~~
In file included from ./procenv.h:67,
                 from ./platform.h:54,
                 from platform/linux/platform-linux.h:25,
                 from platform/linux/platform.c:19:
/usr/include/sys/utsname.h:57:10: note: ‘release’ declared here
   57 |     char release[_UTSNAME_RELEASE_LENGTH];
      |          ^~~~~~~

loveshack avatar Nov 17 '25 15:11 loveshack