Conversation
e464147 to
2180d04
Compare
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
+ Coverage 60.13% 60.13% +<.01%
==========================================
Files 306 306
Lines 49366 49367 +1
==========================================
+ Hits 29685 29686 +1
Misses 19681 19681
Continue to review full report at Codecov.
|
robszewczyk
left a comment
There was a problem hiding this comment.
This code seems to be most relevant to the Legacy WDM code. If clang is complaining, it is perhaps complaining for the wrong reasons; the IncompleteIndication is supposed to override / implement the pure virtual from ProtocolEngine.
| void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport); | ||
| virtual void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport); | ||
|
|
||
| using DMPublisher::IncompleteIndication; |
There was a problem hiding this comment.
I don't quite understand. I believe the the intention here was to have the method above override the DMPublisher::IncompleteIndication; Arguably, it would be appropriate to add the __OVERRIDE macro to the IncompleteIndication. Because the IncompleteIndication already is declared virtual in base, there is no need to declare it virtual here, right?
There was a problem hiding this comment.
I agree, this seems an odd warning. As Jay and I discussed this morning, it might make sense long-term to get rid of "-Wall" in configure.ac and select those warnings we feel actually make sense and add real, measurable value.
Using __OVERRIDE here might be better though that may then trigger -Winconsistent-missing-override. I'll give it a try.
There was a problem hiding this comment.
The using statement here seems to be the required magic but it doesn't make much sense to me based on my knowledge of the language.
The better approach here might be just to disable -Woverloaded-virtual (-Wno-overloaded-virtual) for clang. Thoughts @robszewczyk or @jaylogue?
There was a problem hiding this comment.
IncompleteIndication() has a different signature on the base class:
void IncompleteIndication(Binding *aBinding, StatusReport &aReport)
vs.
void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport)
This is likely erroneous, as nothing appears to call the subclass method.
There was a problem hiding this comment.
Looking at this again, src/lib/profiles/data-management/Legacy/ProtocolEngine.h defines both:
virtual void IncompleteIndication(Binding *aBinding, StatusReport &aReport);
and:
virtual void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport) = 0;
The implementation of the former calls the latter making the base class abstract:
void ProtocolEngine::IncompleteIndication(Binding *aBinding, StatusReport &aReport)
{
bool indicated = FailTransactions(aBinding, aReport);
if (!indicated)
IncompleteIndication(aBinding->mPeerNodeId, aReport);
}
It seems like the test clients correctly override the latter which seems to imply that the warning is a bit pedantic.
| } | ||
|
|
||
| void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport) | ||
| virtual void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport) |
There was a problem hiding this comment.
Unnecessary virtual, but perhaps a beneficial override?
There was a problem hiding this comment.
Agreed. See above.
There was a problem hiding this comment.
As with MockDMPublisher I think this is an error, as nothing calls DMTestClient::IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport).
| } | ||
|
|
||
| void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport) | ||
| virtual void IncompleteIndication(const uint64_t &aPeerNodeId, StatusReport &aReport) |
There was a problem hiding this comment.
Unnecessary virtual but beneficial override?
There was a problem hiding this comment.
Agreed. See above.
No description provided.