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

Compiler Warnings with LLVM/CLANG #114

Closed
tuaris opened this issue Apr 26, 2016 · 1 comment
Closed

Compiler Warnings with LLVM/CLANG #114

tuaris opened this issue Apr 26, 2016 · 1 comment

Comments

@tuaris
Copy link

tuaris commented Apr 26, 2016

Trying to build this on FreeBSD 10.1 and get these warnings

c++ -c -pthread -Wall -Wextra -Wno-sign-compare -Wno-invalid-offsetof -Wno-unused-parameter -Wformat -Wformat-security -g -DBOOST_SPIRIT_THREADSAFE -I/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src -I/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/obj -I/usr/local/include -I/usr/local/include/db48 -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/util.o util.cpp
c++: warning: -Wl,-z,relro: 'linker' input unused
c++: warning: -Wl,-z,now: 'linker' input unused
c++ -c -pthread -Wall -Wextra -Wno-sign-compare -Wno-invalid-offsetof -Wno-unused-parameter -Wformat -Wformat-security -g -DBOOST_SPIRIT_THREADSAFE -I/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src -I/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/obj -I/usr/local/include -I/usr/local/include/db48 -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/wallet.o wallet.cpp
c++: warning: -Wl,-z,relro: 'linker' input unused
c++: warning: -Wl,-z,now: 'linker' input unused
In file included from wallet.cpp:7:
In file included from /usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/wallet.h:9:
In file included from /usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/main.h:11:
/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/script.h:453:22: warning: variable 'nSize' is used uninitialized whenever 'if' condition is false
      [-Wsometimes-uninitialized]
            else if (opcode == OP_PUSHDATA4)
                     ^~~~~~~~~~~~~~~~~~~~~~
/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/script.h:460:30: note: uninitialized use occurs here
            if (end() - pc < nSize)
                             ^~~~~
/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/script.h:453:18: note: remove the 'if' if its condition is always true
            else if (opcode == OP_PUSHDATA4)
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/home/daniel/FreeBSD-Coin-Ports/ports/ppcoin/work/ppcoin-f01ccea/src/script.h:434:31: note: initialize the variable 'nSize' to silence this warning
            unsigned int nSize;
                              ^
                               = 0
1 warning generated.

Other than that, it seems to build and run okay. Should they be fixed?

@peerchemist
Copy link
Member

Clang is simply complaining about old cpp standard used.

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

2 participants