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

warnings not enabled for gcc builds #163

Closed
toxeus opened this issue Jun 11, 2018 · 1 comment
Closed

warnings not enabled for gcc builds #163

toxeus opened this issue Jun 11, 2018 · 1 comment
Labels

Comments

@toxeus
Copy link

toxeus commented Jun 11, 2018

See this travis build logs:

  • gcc dynamic
    ~ ▶ curl -s https://api.travis-ci.org/v3/job/389539896/log.txt | grep 'uninitialized'
    test/chain/block.cpp: In member function ‘void chain_block_tests::block__is_valid_merkle_root__uninitialized__returns_true::test_method()’:
  • gcc static
    ~ ▶ curl -s https://api.travis-ci.org/v3/job/389539897/log.txt | grep 'uninitialized'
    dictbe.cpp:1050:60: warning: ‘current’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    dictbe.cpp:813:60: warning: ‘current’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    dictbe.cpp:620:60: warning: ‘current’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    dictbe.cpp:424:60: warning: ‘current’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    ../common/unicode/unistr.h:4158:64: warning: ‘relativeStringOffset’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    test/chain/block.cpp: In member function ‘void chain_block_tests::block__is_valid_merkle_root__uninitialized__returns_true::test_method()’:
  • clang (all flavours; this is the expected output)
    ~ ▶ curl -s https://api.travis-ci.org/v3/job/389539888/log.txt | grep 'uninitialized'
    src/settings.cpp:33:44: warning: field 'retargeting_factor_' is uninitialized when used here [-Wuninitialized]
    src/settings.cpp:34:44: warning: field 'retargeting_factor_' is uninitialized when used here [-Wuninitialized]
    src/settings.cpp:35:52: warning: field 'target_spacing_seconds_' is uninitialized when used here [-Wuninitialized]
    ``
    

I have the same issue locally. The Makefile generated by configure contains the following lines.

CFLAGS = -g -O2 -Wall -Wextra -Wpedantic -Wno-long-long
CPPFLAGS =
CXXFLAGS = -g -O2 -std=c++11 -Wno-deprecated-declarations -Wno-missing-braces -fvisibility-inlines-hidden -fno-var-tracking-assignments

If I manually append the warning flags from CFLAGS to CXXFLAGS the expected warnings are enabled and printed.

@toxeus
Copy link
Author

toxeus commented Aug 14, 2018

I'm getting warnings now when compiling with gcc. Therefore, I'm closing this.

@toxeus toxeus closed this as completed Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants