Skip to content

Commit 04adca3

Browse files
Merge #6113: backport: bitcoin#21613 -Wdocumentation and related fixes
252ffee fix: adjust doxygen for dash codebase for -Wdocumentation (Konstantin Akimov) 4f260cd fix: ignore warnings for dashbls/ (Konstantin Akimov) 0afffcc Merge bitcoin#21613: build: enable -Wdocumentation (fanquake) Pull request description: ## What was done? Backport bitcoin#21613 to enable -Wdocumentation and related fixes for dash code ## How Has This Been Tested? Build with clang compiler and see no failures anymore with `--enable-werror` ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK 252ffee PastaPastaPasta: utACK 252ffee Tree-SHA512: 1670076665e26228567042ed33ce149780c3992aaa78cdeafeefdc5609b1d1590034a3a2ddc056b69120b2b4e8b0dffaff729b8178043aebe19b1c5880a10d0d
2 parents debc706 + 252ffee commit 04adca3

File tree

15 files changed

+27
-29
lines changed

15 files changed

+27
-29
lines changed

configure.ac

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ if test "x$enable_werror" = "xyes"; then
469469
AX_CHECK_COMPILE_FLAG([-Werror=unreachable-code-loop-increment],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
470470
AX_CHECK_COMPILE_FLAG([-Werror=mismatched-tags], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=mismatched-tags"], [], [$CXXFLAG_WERROR])
471471
AX_CHECK_COMPILE_FLAG([-Werror=implicit-fallthrough], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=implicit-fallthrough"], [], [$CXXFLAG_WERROR])
472+
473+
if test x$suppress_external_warnings != xno ; then
474+
AX_CHECK_COMPILE_FLAG([-Werror=documentation],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=documentation"],,[[$CXXFLAG_WERROR]])
475+
fi
472476
fi
473477

474478
if test "x$CXXFLAGS_overridden" = "xno"; then
@@ -494,6 +498,10 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
494498
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
495499
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
496500

501+
if test x$suppress_external_warnings != xno ; then
502+
AX_CHECK_COMPILE_FLAG([-Wdocumentation],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdocumentation"],,[[$CXXFLAG_WERROR]])
503+
fi
504+
497505
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
498506
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
499507
dnl set the -Wno-foo case if it works.
@@ -1528,6 +1536,10 @@ if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench
15281536
if test x$TARGET_OS != xwindows; then
15291537
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.0.21],, [AC_MSG_ERROR([libevent_pthreads version 2.0.21 or greater not found.])])
15301538
fi
1539+
1540+
if test x$suppress_external_warnings != xno; then
1541+
EVENT_CFLAGS=SUPPRESS_WARNINGS($EVENT_CFLAGS)
1542+
fi
15311543
fi
15321544

15331545
if test x$use_libevent = xyes; then

src/Makefile.am

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ endif
3737
endif #ENABLE_STACKTRACES
3838

3939
BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/secp256k1/include -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
40-
BITCOIN_INCLUDES+=-I$(srcdir)/dashbls/include -I$(srcdir)/dashbls/depends/relic/include -I$(srcdir)/dashbls/depends/minialloc/include
41-
BITCOIN_INCLUDES+=-I$(srcdir)/immer
40+
BITCOIN_INCLUDES+=-isystem$(srcdir)/dashbls/include -isystem$(srcdir)/dashbls/depends/relic/include -isystem$(srcdir)/dashbls/depends/minialloc/include
41+
BITCOIN_INCLUDES+=-isystem$(srcdir)/immer
4242

4343
LIBBITCOIN_SERVER=libbitcoin_server.a
4444
LIBBITCOIN_COMMON=libbitcoin_common.a
@@ -921,8 +921,8 @@ libdashconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_bas
921921
libdashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
922922
libdashconsensus_la_LIBADD = $(LIBDASHBLS) $(LIBSECP256K1) $(GMP_LIBS)
923923
libdashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
924-
libdashconsensus_la_CPPFLAGS += -I$(srcdir)/dashbls/include -I$(srcdir)/dashbls/depends/relic/include -I$(srcdir)/dashbls/depends/minialloc/include
925-
libdashconsensus_la_CPPFLAGS += -I$(srcdir)/immer
924+
libdashconsensus_la_CPPFLAGS += -isystem$(srcdir)/dashbls/include -isystem$(srcdir)/dashbls/depends/relic/include -isystem$(srcdir)/dashbls/depends/minialloc/include
925+
libdashconsensus_la_CPPFLAGS += -isystem$(srcdir)/immer
926926
libdashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
927927

928928
endif

src/cxxtimer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Timer {
107107
/**
108108
* Return the elapsed time.
109109
*
110-
* @param duration_t
110+
* @tparam duration_t
111111
* The duration type used to return the time elapsed. If not
112112
* specified, it returns the time as represented by
113113
* std::chrono::milliseconds.

src/dbwrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class CDBBatch
6161

6262
public:
6363
/**
64-
* @param[in] parent CDBWrapper that this batch is to be submitted to
64+
* @param[in] _parent CDBWrapper that this batch is to be submitted to
6565
*/
6666
explicit CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };
6767

src/evo/deterministicmns.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,23 +346,18 @@ class CDeterministicMNList
346346
* Calculates the projected MN payees for the next *count* blocks. The result is not guaranteed to be correct
347347
* as PoSe banning might occur later
348348
* @param nCount the number of payees to return. "nCount = max()"" means "all", use it to avoid calling GetValidWeightedMNsCount twice.
349-
* @return
350349
*/
351350
[[nodiscard]] std::vector<CDeterministicMNCPtr> GetProjectedMNPayees(gsl::not_null<const CBlockIndex* const> pindexPrev, int nCount = std::numeric_limits<int>::max()) const;
352351

353352
/**
354353
* Calculate a quorum based on the modifier. The resulting list is deterministically sorted by score
355-
* @param maxSize
356-
* @param modifier
357-
* @return
358354
*/
359355
[[nodiscard]] std::vector<CDeterministicMNCPtr> CalculateQuorum(size_t maxSize, const uint256& modifier, const bool onlyEvoNodes = false) const;
360356
[[nodiscard]] std::vector<std::pair<arith_uint256, CDeterministicMNCPtr>> CalculateScores(const uint256& modifier, const bool onlyEvoNodes) const;
361357

362358
/**
363359
* Calculates the maximum penalty which is allowed at the height of this MN list. It is dynamic and might change
364360
* for every block.
365-
* @return
366361
*/
367362
[[nodiscard]] int CalcMaxPoSePenalty() const;
368363

@@ -371,17 +366,13 @@ class CDeterministicMNList
371366
* value later passed to PoSePunish. The percentage should be high enough to take per-block penalty decreasing for MNs
372367
* into account. This means, if you want to accept 2 failures per payment cycle, you should choose a percentage that
373368
* is higher then 50%, e.g. 66%.
374-
* @param percent
375-
* @return
376369
*/
377370
[[nodiscard]] int CalcPenalty(int percent) const;
378371

379372
/**
380373
* Punishes a MN for misbehavior. If the resulting penalty score of the MN reaches the max penalty, it is banned.
381374
* Penalty scores are only increased when the MN is not already banned, which means that after banning the penalty
382375
* might appear lower then the current max penalty, while the MN is still banned.
383-
* @param proTxHash
384-
* @param penalty
385376
*/
386377
void PoSePunish(const uint256& proTxHash, int penalty, bool debugLogs);
387378

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2986,7 +2986,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, const Peer& peer,
29862986
/**
29872987
* Reconsider orphan transactions after a parent has been accepted to the mempool.
29882988
*
2989-
* @param[in/out] orphan_work_set The set of orphan transactions to reconsider. Generally only one
2989+
* @param[in,out] orphan_work_set The set of orphan transactions to reconsider. Generally only one
29902990
* orphan will be reconsidered on each call of this function. This set
29912991
* may be added to if accepting an orphan causes its children to be
29922992
* reconsidered.

src/netbase.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ CService LookupNumeric(const std::string& name, uint16_t portDefault = 0, DNSLoo
176176
* @param strSubnet A string representation of a subnet of the form `network
177177
* address [ "/", ( CIDR-style suffix | netmask ) ]`(e.g.
178178
* `2001:db8::/32`, `192.0.2.0/255.255.255.0`, or `8.8.8.8`).
179-
* @param ret The resulting internal representation of a subnet.
180179
*
181180
* @returns Whether the operation succeeded or not.
182181
*/
@@ -237,7 +236,7 @@ void InterruptSocks5(bool interrupt);
237236
* @param port The destination port.
238237
* @param auth The credentials with which to authenticate with the specified
239238
* SOCKS5 proxy.
240-
* @param sock The SOCKS5 proxy socket.
239+
* @param socket The SOCKS5 proxy socket.
241240
*
242241
* @returns Whether or not the operation succeeded.
243242
*

src/node/transaction.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ static const CFeeRate DEFAULT_MAX_RAW_TX_FEE_RATE{COIN / 10};
3636
* @param[in] node reference to node context
3737
* @param[in] tx the transaction to broadcast
3838
* @param[out] err_string reference to std::string to fill with error string if available
39-
* @param[in] max_tx_fee reject txs with fees higher than this (if 0, accept any fee)
4039
* @param[in] relay flag if both mempool insertion and p2p relay are requested
4140
* @param[in] wait_callback wait until callbacks have been processed to avoid stale result due to a sequentially RPC.
4241
* return error

src/rpc/rawtransaction_util.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class SigningProvider;
1919
* Sign a transaction with the given keystore and previous transactions
2020
*
2121
* @param mtx The transaction to-be-signed
22-
* @param prevTxsUnival Array of previous txns outputs that tx depends on but may not yet be in the block chain
2322
* @param keystore Temporary keystore containing signing keys
2423
* @param coins Map of unspent outputs
2524
* @param hashType The signature hash type
@@ -31,7 +30,7 @@ void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const
3130
/**
3231
* Parse a prevtxs UniValue array and get the map of coins from it
3332
*
34-
* @param prevTxs Array of previous txns outputs that tx depends on but may not yet be in the block chain
33+
* @param prevTxsUnival Array of previous txns outputs that tx depends on but may not yet be in the block chain
3534
* @param keystore A pointer to the temprorary keystore if there is one
3635
* @param coins Map of unspent outputs - coins in mempool and current chain UTXO set, may be extended by previous txns outputs after call
3736
*/

src/util/enumerate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* similar to python's enumerate(iterable).
1212
* @tparam T type of iterable, automatically deduced
13-
* @tparam TIter
13+
* @tparam TIter begin of containter
1414
* @param iterable an iterable object, can be a temporary
1515
* @return struct containing a size_t index, and it's element in iterable
1616
*/

0 commit comments

Comments
 (0)