Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error: lib/LZMA/LzmaEnc.c:2996:19: error: storing the address of local variable ‘outStream’ in ‘p_16->rc.outStream’ [-Werror=dangling-pointer=] #84

Closed
Jieiku opened this issue Jun 9, 2022 · 1 comment

Comments

@Jieiku
Copy link

Jieiku commented Jun 9, 2022

OS: Manjaro KDE Minimal LTS
clang-13.0.1-2
gcc-12.1.0-2

git clone https://github.com/JayXon/Leanify
cd Leanify
make
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o leanify.o leanify.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o main.o main.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o utils.o utils.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/base64.o formats/base64.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/bmp.o formats/bmp.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/data_uri.o formats/data_uri.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/dwf.o formats/dwf.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/gft.o formats/gft.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/gz.o formats/gz.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/ico.o formats/ico.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/jpeg.o formats/jpeg.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/lua.o formats/lua.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/mime.o formats/mime.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/pe.o formats/pe.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/png.o formats/png.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/rdb.o formats/rdb.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/swf.o formats/swf.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/tar.o formats/tar.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/vcf.o formats/vcf.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/xml.o formats/xml.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o formats/zip.o formats/zip.cpp
g++ -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -Wextra -Wno-unused-parameter -std=c++17 -fno-rtti -I./lib  -c -o fileio_linux.o fileio_linux.cpp
cc -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -I./lib  -c -o lib/LZMA/Alloc.o lib/LZMA/Alloc.c
cc -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -I./lib  -c -o lib/LZMA/LzFind.o lib/LZMA/LzFind.c
cc -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -I./lib  -c -o lib/LZMA/LzFindMt.o lib/LZMA/LzFindMt.c
cc -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -I./lib  -c -o lib/LZMA/LzFindOpt.o lib/LZMA/LzFindOpt.c
cc -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -I./lib  -c -o lib/LZMA/LzmaDec.o lib/LZMA/LzmaDec.c
cc -Wall -Werror -O3 -msse2 -mfpmath=sse -flto -I./lib  -c -o lib/LZMA/LzmaEnc.o lib/LZMA/LzmaEnc.c
lib/LZMA/LzmaEnc.c: In function ‘LzmaEnc_CodeOneMemBlock’:
lib/LZMA/LzmaEnc.c:2996:19: error: storing the address of local variable ‘outStream’ in ‘p_16->rc.outStream’ [-Werror=dangling-pointer=]
 2996 |   p->rc.outStream = &outStream.vt;
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
lib/LZMA/LzmaEnc.c:2979:28: note: ‘outStream’ declared here
 2979 |   CLzmaEnc_SeqOutStreamBuf outStream;
      |                            ^~~~~~~~~
lib/LZMA/LzmaEnc.c:2979:28: note: ‘pp_15(D)’ declared here
cc1: all warnings being treated as errors
make: *** [<builtin>: lib/LZMA/LzmaEnc.o] Error 1
@Jieiku
Copy link
Author

Jieiku commented Jun 9, 2022

Thank You! Wonderful program, compressed my websites favicon.ico nicely!

This was how I ran it:

./leanify -i 9999 favicon.ico
Processing: favicon.ico
2.59 KB -> 1.90 KB      Leanified: 703 B (26.53%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant