refactor: Annotate `MakeAndPushFeature` with `[[maybe_unused]]`
What changed, and why it matters
This is a one-line compiler warning fix. A developer added a marker telling the compiler that a newly-added helper function may not be used yet, so Clang 23 stops complaining about it. There is no change to program behavior, no bug fix, and no security relevance.
No security action needed. Treat as normal code-quality/maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds the [[maybe_unused]] attribute to the MakeAndPushFeature template member function in src/net_processing.cpp. The function currently has no callers, and Clang 23 newly enables -Wunused-template under -Wall. The attribute suppresses that warning without altering code generation or runtime behavior. It is a pure refactor/follow-up to PR #35221.
Changed components
src/net_processing.cppInspect captured patch +1 / −1
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 03e5c90b..b0c2a441 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -804,7 +804,7 @@ private:
m_connman.PushMessage(&node, NetMsg::Make(std::move(msg_type), std::forward<Args>(args)...));
}
template <typename... Args>
- void MakeAndPushFeature(CNode& node, std::string_view feature_id, Args&&... args) const
+ [[maybe_unused]] void MakeAndPushFeature(CNode& node, std::string_view feature_id, Args&&... args) const
{
if (!Assume(feature_id.size() >= 4 && feature_id.size() <= MAX_FEATUREID_LENGTH)) return;
std::vector<unsigned char> feature_data;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.