sockets: add missing override keywords on CEMSocket-derived classes - #625
Merged
mrjimenez merged 1 commit intoMay 15, 2026
Merged
Conversation
PR amule-project#615 added IsDownloadThrottled() with the override keyword on CServerSocket. That made Clang's -Winconsistent-missing-override fire on the existing CServerSocket overrides (OnClose / OnConnect / OnReceive / OnError / PacketReceived / SendPacket) that were missing the keyword. Reported by Stoatwblr on amule-project#622. Add override to the affected six methods in CServerSocket, and apply the same cleanup to CClientTCPSocket -- which has the identical inheritance shape from CEMSocket and was one stray override keyword away from triggering the same warning. Also drop the redundant virtual keyword on the derived overrides (override implies virtual). Build clean on macOS arm64; warning gone on the Linux build path Stoatwblr was using.
Closed
|
warnings gone, thanks |
This was referenced May 20, 2026
mrjimenez
pushed a commit
that referenced
this pull request
May 20, 2026
Both methods in UnitTestApp override virtuals on wxAppConsole / wxApp (wx/app.h:103 and :303). Clang -Winconsistent-missing-override fires because the sibling OnInit in the same class already has override. Same pattern as #625 (ServerSocket.h / ClientTCPSocket.h cleanup): just add override to the two declarations. Reported by @Stoatwblr in #663.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #615 added
IsDownloadThrottled() overridetoCServerSocket. Clang's-Winconsistent-missing-override(enabled by default in-Wallon recent Clang) fires the moment any one method in a class usesoverrideand others in the same class don't, so the older overrides in the class now produce warnings:Reported by @Stoatwblr in #622 while compiling against
libwx_gtk3u-3.2.so.0on Ubuntu.Fix
Add
overrideto the six existing overrides inCServerSocket(OnClose,OnConnect,OnReceive,OnError,PacketReceived,SendPacket) and to the nine overrides in the structurally identicalCClientTCPSocket(sameCEMSocketparent, same set of virtuals plusOnSend,SendControlData,SendFileAndControlData).Also drop the redundant
virtualkeyword on the derivedSendPacket/SendControlData/SendFileAndControlData/PacketReceivedinCClientTCPSocket—overrideimpliesvirtual, and keeping both is redundant.Validation
macOS arm64 with Apple Clang: rebuilt
amuletarget —-Winconsistent-missing-overrideno longer fires in either header. No behaviour change; this is purely a compiler-hint cleanup.