rurban / safeclib

safec libc extension with all C11 Annex K functions
https://rurban.github.io/safeclib/
Other
329 stars 64 forks source link

3.6: build fails with gcc 12.0.0 #110

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

gcc 12.0.0 frpom fedora rawhide.

[tkloczko@ss-desktop safeclib-3.6]$ make
make  all-recursive
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/safeclib-3.6'
Making all in src
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/safeclib-3.6/src'
/bin/sh ../libtool  --tag=CC   --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -I..  -I../include  -I../include -I. -pedantic -fno-strict-aliasing -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wcast-align -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Wpacked -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init -Werror -Wno-suggest-attribute=format -Wno-error=unused-parameter -Wno-error=missing-field-initializers -fstack-protector-strong -fstack-clash-protection -fcf-protection  -O2 -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 -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -c -o misc/qsort_s.lo misc/qsort_s.c
libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -I. -pedantic -fno-strict-aliasing -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wcast-align -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Wpacked -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init -Werror -Wno-suggest-attribute=format -Wno-error=unused-parameter -Wno-error=missing-field-initializers -fstack-protector-strong -fstack-clash-protection -fcf-protection -O2 -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 -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -c misc/qsort_s.c  -fPIC -DPIC -o misc/.libs/qsort_s.o
misc/qsort_s.c: In function ‘cycle’:
misc/qsort_s.c:177:11: error: storing the address of local variable ‘tmp’ in ‘*_3’ [-Werror=dangling-pointer=]
  177 |     ar[n] = tmp;
      |     ~~~~~~^~~~~
misc/qsort_s.c:169:19: note: ‘tmp’ declared here
  169 |     unsigned char tmp[256];
      |                   ^~~
misc/qsort_s.c:169:19: note: ‘ar_32(D)’ declared here
cc1: all warnings being treated as errors
rurban commented 2 years ago

Hmm, timely catch. I was just preparing the 3.7 release...