Skip to content

compilation failure for global/src/sketch.c #374

@ajmay81

Description

@ajmay81

The default gcc with the newly released opensuse 16.0 has been configured to have -Werror=return-type by default:

# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/15/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-suse-linux
Configured with: ../configure CFLAGS=' -O2 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g' CXXFLAGS=' -O2 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g' XCFLAGS=' -O2 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g' TCFLAGS=' -O2 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g' GDCFLAGS=' -O2 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d,jit,m2 --enable-host-pie --enable-offload-targets=nvptx-none,amdgcn-amdhsa, --enable-offload-defaulted --without-cuda-driver --enable-host-shared --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/15 --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-15 --without-system-libunwind --enable-multilib --with-arch-32=x86-64-v2 --with-arch=x86-64-v2 --with-tune=generic --with-build-config=bootstrap-lto-lean --enable-link-serialization --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.1 20250714 (SUSE Linux)

This results in:

libtool: compile:  mpicc -DHAVE_CONFIG_H -I. -Ima -I./ma -I./LinAlg/lapack+blas -Iglobal/src -I./global/src -I./global/testing -I./pario/dra -I./pario/eaf -I./pario/elio -I./pario/sf -Igaf2c -I./gaf2c -I./tcgmsg -I./tcgmsg/tcgmsg-mpi -I./comex/src-armci -fno-aggressive-loop-optimizations -fno-tree-slp-vectorize -std=gnu17 -MT global/src/sketch.lo -MD -MP -MF global/src/.deps/sketch.Tpo -c global/src/sketch.c -o global/src/sketch.o
global/src/sketch.c: In function 'pnga_sprs_array_count_sketch':
global/src/sketch.c:102:18: warning: unused variable 'kcnt' [-Wunused-variable]
  102 |   Integer k, kk, kcnt;
      |                  ^~~~
global/src/sketch.c:88:21: warning: unused variable 'jj' [-Wunused-variable]
   88 |   Integer i, ii, j, jj, n, hdl, g_a;
      |                     ^~
global/src/sketch.c:88:18: warning: unused variable 'j' [-Wunused-variable]
   88 |   Integer i, ii, j, jj, n, hdl, g_a;
      |                  ^
global/src/sketch.c:88:14: warning: unused variable 'ii' [-Wunused-variable]
   88 |   Integer i, ii, j, jj, n, hdl, g_a;
      |              ^~
global/src/sketch.c: In function 'pnga_sprs_array_num_nonzeros':
global/src/sketch.c:441:1: error: control reaches end of non-void function [-Werror=return-type]
  441 | }
      | ^
cc1: some warnings being treated as error

For now one can work around this by explicitly disabling this at configure time:

./configure CFLAGS='-Wno-error=return-type' ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions