build: Enable some commonly enabled compiler diagnostics #19015

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:compiler-diagnostics changing 1 files +4 −0
  1. practicalswift commented at 12:39 pm on May 19, 2020: contributor

    Enable some commonly enabled compiler diagnostics as discussed in #17344.

    Compiler diagnostic no# of emitted unique GCC warnings in master no# of emitted unique Clang warnings in master
    -Wduplicated-branches: Warn if if/else branches have duplicated code 0 Not supported
    -Wduplicated-cond: Warn if if/else chain has duplicated conditions 0 Not supported
    -Wlogical-op: Warn about logical operations being used where bitwise were probably wanted 0 Not supported
    -Woverloaded-virtual: Warn if you overload (not override) a virtual function 0 0
    -Wunused-member-function: Warn on unused member function Not supported 2
    -Wunused-template: Warn on unused template Not supported 1

    There is a large overlap between this list and Jason Turner’s list of recommended compiler diagnostics in the Collaborative Collection of C++ Best Practices (cppbestpractices) project. There is also an overlap with the recommendations given in the C++ Core Guidelines (with editors Bjarne Stroustrup and Herb Sutter).

    Closes #17344.

  2. fanquake added the label Build system on May 19, 2020
  3. MarcoFalke commented at 1:10 pm on May 19, 2020: member
    Concept ACK, but before merge we should check that there are no warnings. This includes warnings in headers of third-party libraries. Boost and Qt have a good track record of producing warnings.
  4. hebasto commented at 4:18 pm on May 19, 2020: member
    Concept ACK.
  5. MarcoFalke added the label Needs Guix build on May 21, 2020
  6. DrahtBot commented at 1:34 am on May 22, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18857 (build: avoid repetitions when enabling warnings in configure.ac by vasild)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. DrahtBot removed the label Needs Guix build on May 23, 2020
  8. MarcoFalke added the label Needs Guix build on May 23, 2020
  9. DrahtBot removed the label Needs Guix build on May 25, 2020
  10. MarcoFalke added the label Needs gitian build on May 26, 2020
  11. MarcoFalke deleted a comment on May 26, 2020
  12. DrahtBot removed the label Needs gitian build on May 28, 2020
  13. MarcoFalke deleted a comment on May 28, 2020
  14. MarcoFalke added the label Needs gitian build on May 28, 2020
  15. DrahtBot removed the label Needs gitian build on May 29, 2020
  16. jonathanschoeller referenced this in commit eea8114657 on Jun 1, 2020
  17. laanwj referenced this in commit b46fb5cb10 on Jun 4, 2020
  18. hebasto commented at 4:03 pm on June 4, 2020: member

    @practicalswift Why this PR does not include changes to get rid of new warnings?

    master (39afe5b1c68c5979b2ef2f03b60ec6a57901328f) + this PR:

     0$ make -j 9 > /dev/null 
     1script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function]
     2    int GetType() const { return m_type; }
     3        ^
     41 warning generated.
     5index/blockfilterindex.cpp:54:5: warning: unused member function 'DBHeightKey' [-Wunused-member-function]
     6    DBHeightKey() : height(0) {}
     7    ^
     8index/blockfilterindex.cpp:80:5: warning: unused function template 'Unserialize' [-Wunused-template]
     9    SERIALIZE_METHODS(DBHashKey, obj) {
    10    ^
    11./serialize.h:215:10: note: expanded from macro 'SERIALIZE_METHODS'
    12    void Unserialize(Stream& s)                                                     \
    13         ^
    14index/blockfilterindex.cpp:80:5: warning: unused function template 'Unser' [-Wunused-template]
    15./serialize.h:220:5: note: expanded from macro 'SERIALIZE_METHODS'
    16    FORMATTER_METHODS(cls, obj)
    17    ^
    18./serialize.h:196:17: note: expanded from macro 'FORMATTER_METHODS'
    19    static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, CSerActionUnserialize()); } \
    20                ^
    213 warnings generated.
    22script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function]
    23    int GetType() const { return m_type; }
    24        ^
    251 warning generated.
    26test/util_tests.cpp:1972:14: warning: member function 'operator=' is not needed and will not be emitted [-Wunneeded-member-function]
    27    Tracker& operator=(Tracker&& t) noexcept
    28             ^
    291 warning generated.
    
  19. sidhujag referenced this in commit 2ab90a2fe4 on Jun 4, 2020
  20. practicalswift commented at 7:35 am on June 5, 2020: contributor
    @hebasto Thanks for testing! I wanted to keep this PR build-system only to keep review simple. Feel free to tackle the warnings in a separate PR if you want :)
  21. MarcoFalke deleted a comment on Jun 5, 2020
  22. MarcoFalke deleted a comment on Jun 5, 2020
  23. MarcoFalke added the label Waiting for author on Jun 5, 2020
  24. practicalswift commented at 10:49 am on June 7, 2020: contributor
    @MarcoFalke I don’t think this one needs rebase - anything else that you had in mind with the “waiting for author” label? :)
  25. MarcoFalke commented at 10:55 am on June 7, 2020: member
    -Wunreachable-code-loop-increment has been merged (silent merge conflict), so it needs to be removed (with or without a rebase)
  26. practicalswift force-pushed on Jun 7, 2020
  27. practicalswift commented at 7:40 pm on June 7, 2020: contributor
    @MarcoFalke Oh, thanks for clarifying! Now fixed :)
  28. MarcoFalke removed the label Waiting for author on Jun 7, 2020
  29. practicalswift commented at 2:44 pm on June 8, 2020: contributor
    The Travis TSan job failure is unrelated but I’m unable to re-run the job :)
  30. MarcoFalke commented at 2:53 pm on June 8, 2020: member
    Another rebase would make it rerun
  31. practicalswift force-pushed on Jun 8, 2020
  32. stackman27 referenced this in commit 2d9b7d8233 on Jun 26, 2020
  33. MarcoFalke added the label Needs gitian build on Jul 2, 2020
  34. DrahtBot removed the label Needs gitian build on Jul 3, 2020
  35. fanquake commented at 11:17 am on August 10, 2020: member

    Concept ACK

    Thanks for testing! I wanted to keep this PR build-system only to keep review simple. Feel free to tackle the warnings in a separate PR if you want :)

    There’s not really a rush to do this, and it’s unlikely this will be merged while it introduces any new (presumably easy to fix?) warnings. So if we’re going to turn new diagnostics on, let’s just take care of any warnings now, or, if you’d rather not deal with code changes, please reduce the scope of this PR.

    I checked out this branch and started building. Spamming the log with the following is not going to be useful, and in this case it’s coming from the brew installed Boost:

      0Options used to compile and link:
      1  multiprocess  = no
      2  with wallet   = yes
      3  with gui / qt = yes
      4    with qr     = yes
      5  with zmq      = yes
      6  with test     = yes
      7    with fuzz   = no
      8  with bench    = yes
      9  with upnp     = yes
     10  use asm       = yes
     11  sanitizers    = 
     12  debug enabled = no
     13  gprof enabled = no
     14  werror        = no
     15
     16  target os     = darwin
     17  build os      = darwin19.6.0
     18
     19  CC            = /usr/local/bin/ccache gcc
     20  CFLAGS        = -g -O2
     21  CPPFLAGS      =   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -I/usr/local/opt/berkeley-db@4/include -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0
     22  CXX           = /usr/local/bin/ccache g++ -std=c++11
     23  CXXFLAGS      =   -Wstack-protector -fstack-protector-all  -Wall -Wextra -Wgnu -Wformat -Wvla -Wshadow-field -Wswitch -Wformat-security -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunused-variable -Wdate-time -Wconditional-uninitialized -Wsign-compare -Woverloaded-virtual -Wunused-member-function -Wunused-template -Wunreachable-code-loop-increment  -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough   -g -O2
     24  LDFLAGS       = -pthread  -Wl,-bind_at_load   -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-dead_strip_dylibs
     25  ARFLAGS       = cr
     26
     27/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src bitcoind
     28  CXX      bitcoind-bitcoind.o
     29  CXX      libbitcoin_server_a-addrdb.o
     30  CXX      libbitcoin_server_a-addrman.o
     31  CXX      libbitcoin_server_a-banman.o
     32  CXX      libbitcoin_server_a-blockencodings.o
     33  CXX      libbitcoin_server_a-blockfilter.o
     34  CXX      libbitcoin_server_a-chain.o
     35  CXX      libbitcoin_server_a-flatfile.o
     36  CXX      libbitcoin_server_a-httprpc.o
     37  CXX      libbitcoin_server_a-httpserver.o
     38  CXX      libbitcoin_server_a-init.o
     39  CXX      libbitcoin_server_a-dbwrapper.o
     40  CXX      libbitcoin_server_a-miner.o
     41  CXX      libbitcoin_server_a-net.o
     42  CXX      libbitcoin_server_a-net_processing.o
     43In file included from blockencodings.cpp:13:
     44In file included from ./txmempool.h:26:
     45In file included from /usr/local/include/boost/multi_index_container.hpp:32:
     46In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
     47In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
     48In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
     49In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
     50In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
     51In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
     52In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
     53In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
     54In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
     55/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
     56template< typename T > static T const& ptr_to_ref(T*);
     57                                       ^
     581 warning generated.
     59  CXX      libbitcoin_server_a-noui.o
     60  CXX      libbitcoin_server_a-pow.o
     61  CXX      libbitcoin_server_a-rest.o
     62  CXX      libbitcoin_server_a-shutdown.o
     63  CXX      libbitcoin_server_a-timedata.o
     64  CXX      libbitcoin_server_a-torcontrol.o
     65  CXX      libbitcoin_server_a-txdb.o
     66In file included from miner.cpp:6:
     67In file included from ./miner.h:11:
     68In file included from ./txmempool.h:26:
     69In file included from /usr/local/include/boost/multi_index_container.hpp:32:
     70In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
     71In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
     72In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
     73In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
     74In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
     75In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
     76In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
     77In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
     78In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
     79/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
     80template< typename T > static T const& ptr_to_ref(T*);
     81                                       ^
     821 warning generated.
     83  CXX      libbitcoin_server_a-txmempool.o
     84  CXX      libbitcoin_server_a-ui_interface.o
     85  CXX      libbitcoin_server_a-validation.o
     86In file included from rest.cpp:19:
     87In file included from ./txmempool.h:26:
     88In file included from /usr/local/include/boost/multi_index_container.hpp:32:
     89In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
     90In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
     91In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
     92In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
     93In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
     94In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
     95In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
     96In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
     97In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
     98/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
     99template< typename T > static T const& ptr_to_ref(T*);
    100                                       ^
    1011 warning generated.
    102  CXX      libbitcoin_server_a-validationinterface.o
    103  CXX      libbitcoin_server_a-versionbits.o
    104  CXX      interfaces/libbitcoin_wallet_a-wallet.o
    105  CXX      wallet/libbitcoin_wallet_a-coincontrol.o
    106In file included from txmempool.cpp:6:
    107In file included from ./txmempool.h:26:
    108In file included from /usr/local/include/boost/multi_index_container.hpp:32:
    109In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
    110In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
    111In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
    112In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
    113In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
    114In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
    115In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
    116In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
    117In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
    118/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
    119template< typename T > static T const& ptr_to_ref(T*);
    120                                       ^
    1211 warning generated.
    122  CXX      wallet/libbitcoin_wallet_a-context.o
    123  CXX      wallet/libbitcoin_wallet_a-crypter.o
    124  CXX      wallet/libbitcoin_wallet_a-db.o
    125In file included from init.cpp:28:
    126In file included from ./miner.h:11:
    127In file included from ./txmempool.h:26:
    128In file included from /usr/local/include/boost/multi_index_container.hpp:32:
    129In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
    130In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
    131In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
    132In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
    133In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
    134In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
    135In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
    136In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
    137In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
    138/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
    139template< typename T > static T const& ptr_to_ref(T*);
    140                                       ^
    1411 warning generated.
    142  CXX      wallet/libbitcoin_wallet_a-feebumper.o
    143  CXX      wallet/libbitcoin_wallet_a-fees.o
    144  CXX      wallet/libbitcoin_wallet_a-load.o
    145  CXX      wallet/libbitcoin_wallet_a-rpcdump.o
    146In file included from net_processing.cpp:16:
    147In file included from ./validation.h:22:
    148In file included from ./txmempool.h:26:
    149In file included from /usr/local/include/boost/multi_index_container.hpp:32:
    150In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
    151In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
    152In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
    153In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
    154In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
    155In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
    156In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
    157In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
    158In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
    159/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
    160template< typename T > static T const& ptr_to_ref(T*);
    161                                       ^
    1621 warning generated.
    163
    164> Killed build.
    
  36. MarcoFalke deleted a comment on Aug 10, 2020
  37. MarcoFalke added the label Waiting for author on Aug 10, 2020
  38. practicalswift commented at 9:05 am on August 11, 2020: contributor
    @fanquake Thanks for testing, and your feedback makes sense: I’ll adjust accordingly. I don’t have any macOS machine to test on – would you mind sharing the results of make 2>&1 | grep "warning: " | sort | uniq -c? :)
  39. fanquake commented at 11:52 am on August 11, 2020: member

    I don’t have any macOS machine to test on

    You should just be able to just check the Travis output:

     0Making install in src
     1< snip >
     2  CXX      libbitcoin_server_a-init.o
     3In file included from blockencodings.cpp:13:
     4In file included from ./txmempool.h:26:
     5In file included from /usr/local/include/boost/multi_index_container.hpp:32:
     6In file included from /usr/local/include/boost/multi_index_container_fwd.hpp:19:
     7In file included from /usr/local/include/boost/multi_index/ordered_index_fwd.hpp:16:
     8In file included from /usr/local/include/boost/multi_index/detail/ord_index_args.hpp:21:
     9In file included from /usr/local/include/boost/multi_index/tag.hpp:17:
    10In file included from /usr/local/include/boost/multi_index/detail/no_duplicate_tags.hpp:18:
    11In file included from /usr/local/include/boost/mpl/set/set0.hpp:18:
    12In file included from /usr/local/include/boost/mpl/set/aux_/at_impl.hpp:18:
    13In file included from /usr/local/include/boost/mpl/set/aux_/has_key_impl.hpp:21:
    14In file included from /usr/local/include/boost/mpl/aux_/overload_names.hpp:17:
    15/usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
    16template< typename T > static T const& ptr_to_ref(T*);
    17                                       ^
    181 warning generated.
    

    make 2>&1 | grep “warning: " | sort | uniq -c

     0  12 /usr/local/Cellar/qt/5.15.0/lib/QtCore.framework/Headers/qtestsupport_core.h:55:31: warning: unused function template 'qWaitFor' [-Wunused-template]
     1 137 /usr/local/include/boost/mpl/aux_/ptr_to_ref.hpp:42:40: warning: unused function template 'ptr_to_ref' [-Wunused-template]
     2   1 index/blockfilterindex.cpp:54:5: warning: unused member function 'DBHeightKey' [-Wunused-member-function]
     3   1 index/blockfilterindex.cpp:80:5: warning: unused function template 'Unser' [-Wunused-template]
     4   1 index/blockfilterindex.cpp:80:5: warning: unused function template 'Unserialize' [-Wunused-template]
     5   1 qt/bitcoin.cpp:259:53: warning: 'QFlags' is deprecated: Use default constructor instead [-Wdeprecated-declarations]
     6   1 qt/bitcoingui.cpp:1304:29: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
     7   1 qt/optionsmodel.cpp:222:59: warning: 'split' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations]
     8   1 qt/qrimagewidget.cpp:100:12: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
     9   1 qt/qrimagewidget.cpp:105:45: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
    10   1 qt/qrimagewidget.cpp:121:9: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
    11   1 qt/qrimagewidget.cpp:132:9: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
    12   1 qt/qrimagewidget.cpp:139:9: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
    13   1 qt/qrimagewidget.cpp:98:9: warning: 'pixmap' is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
    14   1 qt/sendcoinsdialog.cpp:174:72: warning: 'buttonClicked' is deprecated: Use QButtonGroup::idClicked(int) instead [-Wdeprecated-declarations]
    15   1 qt/sendcoinsdialog.cpp:175:72: warning: 'buttonClicked' is deprecated: Use QButtonGroup::idClicked(int) instead [-Wdeprecated-declarations]
    16   1 qt/transactionview.cpp:240:85: warning: 'split' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations]
    17   1 qt/transactionview.cpp:278:17: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    18   1 qt/transactionview.cpp:285:17: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    19   1 qt/transactionview.cpp:291:17: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    20   1 qt/transactionview.cpp:296:17: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    21   1 qt/transactionview.cpp:297:17: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    22   1 qt/transactionview.cpp:301:17: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    23   1 qt/transactionview.cpp:586:13: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    24   1 qt/transactionview.cpp:587:13: warning: 'QDateTime' is deprecated: Use QDate::startOfDay() [-Wdeprecated-declarations]
    25   1 random.cpp:257:13: warning: unused function 'GetDevURandom' [-Wunused-function]
    26   2 script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function]
    27   1 test/util_tests.cpp:1972:14: warning: unused member function 'operator=' [-Wunused-member-function]
    
  40. build: Enable some commonly enabled compiler diagnostics 2f8a4c9a06
  41. practicalswift force-pushed on Aug 11, 2020
  42. practicalswift commented at 12:10 pm on August 11, 2020: contributor

    I don’t have any macOS machine to test on

    You should just be able to just check the Travis output:

    Oh, of course! Thanks! :)

    I’ve now updated the PR to only enable -Wduplicated-branches, -Wduplicated-cond, -Wlogical-op and -Woverloaded-virtual. None of these should warn on current master.

    Should be ready for final review :)

  43. fanquake removed the label Waiting for author on Aug 14, 2020
  44. hebasto approved
  45. hebasto commented at 1:41 pm on August 15, 2020: member

    ACK 2f8a4c9a06ace680b3dff7cd7d5e33204fe45909, no new warnings in Travis jobs.

    Are there any reasons for not adding corresponding -Werror?

  46. jonatack commented at 3:31 pm on August 15, 2020: member
    ACK 2f8a4c9a06ace6 no warnings for me with these locally on debian 5.7.10-1 (2020-07-26) x86_64 with gcc 10 and clang 12
  47. fanquake approved
  48. fanquake commented at 4:59 am on August 18, 2020: member
    ACK 2f8a4c9a06ace680b3dff7cd7d5e33204fe45909 - no-longer seeing any obvious issues with doing this.
  49. fanquake merged this on Aug 18, 2020
  50. fanquake closed this on Aug 18, 2020

  51. sidhujag referenced this in commit 64f37492b7 on Aug 18, 2020
  52. practicalswift commented at 4:57 am on September 8, 2020: contributor

    A post-merge success story: only 21 days after merge -Wlogical-op caught the first bug in the form of #19912 :)

    0wallet/scriptpubkeyman.cpp:455:55: warning: logical and applied to non-boolean constant [-Wlogical-op]
    1  455 |     if (m_storage.CanSupportFeature(FEATURE_HD_SPLIT) && CHDChain::VERSION_HD_CHAIN_SPLIT) {
    2      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Thanks a lot for reporting @kristapsk! ❤️

    Perhaps we should do -Werror=logical-op.

  53. practicalswift deleted the branch on Apr 10, 2021
  54. Fabcien referenced this in commit 5c2868f3d5 on Sep 15, 2021
  55. Fabcien referenced this in commit 6fc14008fb on Sep 15, 2021
  56. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me