Skip to content

Commit 53d29e9

Browse files
committed
fix: sidestep -Wunused-function warnings with [[maybe_unused]]
Code is unused but inherited by upstream and therefore, has to stick around even if we do nothing with it.
1 parent 9315e69 commit 53d29e9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/script/bitcoinconsensus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class TxInputStream
4848
return *this;
4949
}
5050

51-
int GetVersion() const { return m_version; }
51+
[[maybe_unused]] int GetVersion() const { return m_version; }
5252
private:
5353
const int m_version;
5454
const unsigned char* m_data;

src/script/interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ template void PrecomputedTransactionData::Init(const CMutableTransaction& txTo,
15211521
template PrecomputedTransactionData::PrecomputedTransactionData(const CTransaction& txTo);
15221522
template PrecomputedTransactionData::PrecomputedTransactionData(const CMutableTransaction& txTo);
15231523

1524-
static bool HandleMissingData(MissingDataBehavior mdb)
1524+
[[maybe_unused]] static bool HandleMissingData(MissingDataBehavior mdb)
15251525
{
15261526
switch (mdb) {
15271527
case MissingDataBehavior::ASSERT_FAIL:

src/test/script_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,19 @@ class TestBuilder
282282
return *this;
283283
}
284284

285-
TestBuilder& Push(const std::string& hex)
285+
[[maybe_unused]] TestBuilder& Push(const std::string& hex)
286286
{
287287
DoPush(ParseHex(hex));
288288
return *this;
289289
}
290290

291-
TestBuilder& Push(const uint256& hash)
291+
[[maybe_unused]] TestBuilder& Push(const uint256& hash)
292292
{
293293
DoPush(ToByteVector(hash));
294294
return *this;
295295
}
296296

297-
TestBuilder& Push(const CScript& script)
297+
[[maybe_unused]] TestBuilder& Push(const CScript& script)
298298
{
299299
DoPush(std::vector<unsigned char>(script.begin(), script.end()));
300300
return *this;

0 commit comments

Comments
 (0)