besser82 / libxcrypt

Extended crypt library for descrypt, md5crypt, bcrypt, and others
GNU Lesser General Public License v2.1
196 stars 53 forks source link

Compile error with gcc 15-20241117 -Wunterminated-string-initialization #194

Open heitbaum opened 4 days ago

heitbaum commented 4 days ago

https://github.com/besser82/libxcrypt/blob/dabbc158371f56d44ab8daac0992400afaf6da15/lib/util-base64.c#L23-L27

/bin/dash ./libtool  --tag=CC   --mode=compile /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libxcrypt-4.4.36  -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libxcrypt-4.4.36/lib -DIN_LIBCRYPT  -Wall -Wextra -Walloc-zero -Walloca -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation=1 -Wlogical-op -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wpointer-arith -Wrestrict -Wshadow -Wstrict-overflow=2 -Wstrict-prototypes -Wundef -Wvla -Wwrite-strings -Wpedantic -Werror -fno-plt -march=x86-64-v3 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -MT lib/libcrypt_la-util-xbzero.lo -MD -MP -MF lib/.deps/libcrypt_la-util-xbzero.Tpo -c -o lib/libcrypt_la-util-xbzero.lo `test -f 'lib/util-xbzero.c' || echo '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/libxcrypt-4.4.36/'`lib/util-xbzero.c
../lib/util-base64.c:24:3: error: initializer-string for array of 'unsigned char' is too long [-Werror=unterminated-string-initialization]
   24 |   "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
WentsingNee commented 4 days ago

me too

https://github.com/microsoft/vcpkg/issues/41695