Closed nkh0472 closed 3 years ago
Add -Wstringop-overflow=0
to CFLAGS
could hide the warning.
It seems that you somehow specify custom CFLAGS. As far as I can see, -flto switch triggers it. Try without it. Since you have added -flto, it's your problem. Not mine.
You are right. Will close is issue soon.
There is a warning when compiling fdkaac 1.0.2 using the latest MinGW with MYSYS2:
The compile script is basically as follows:
``` cd fdkaac-1.0.2 autoreconf -i #warning happens in next command CC="gcc -pipe -static-libgcc" CXX="g++ -pipe -static-libgcc" ./configure --prefix=$MINGW_PREFIX/$MINGW_CHOST/ CFLAGS="-O3 -flto -march=native" make -j8 make install ```(full logs in https://github.com/kekyo/fdk-aac-win32-builder/issues/9#issuecomment-852979506)
Code related to the problem
https://github.com/nu774/fdkaac/blob/347e995cfc44941f6d6dfe8d4e09362a71ea8d26/src/pcm_readhelper.c#L207-L208 https://github.com/nu774/fdkaac/blob/347e995cfc44941f6d6dfe8d4e09362a71ea8d26/src/pcm_readhelper.c#L230-L231According to a similar problem in another project (https://github.com/tarantool/tarantool/issues/5564), this warning is due to a zero-lenght array, and happened when using GCC version >= 10.
I don't know how to fix this, but this info might be helpful https://github.com/tarantool/tarantool/commit/8915ae203f873198caf76fbad4bf9edce76a6153.
Version info of GCC
``` $ gcc -v Using built-in specs. COLLECT_GCC=E:\Etc\HUGE\msys64\mingw64\bin\gcc.exe COLLECT_LTO_WRAPPER=E:/Etc/HUGE/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../gcc-10.3.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-boot-ldflags='-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc' 'LDFLAGS_FOR_TARGET=-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high' --enable-linker-plugin-flags='LDFLAGS=-static-libstdc++\ -static-libgcc\ -pipe\ -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high\ -Wl,--stack,12582912' Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.3.0 (Rev2, Built by MSYS2 project) ```