cleanup: 4 cosmetic fixes from clang-tidy worklist - #774
Merged
mrjimenez merged 1 commit intoMay 30, 2026
Conversation
amule-project#770) Third cleanup pass from the worklist, addressing the items the analyzer flags as latent (not crashy) but worth tidying: - src/libs/ec/cpp/ECTag.h -- EC_IPv4_t::EC_IPv4_t() left m_ip and m_port uninitialised, so a stack-allocated instance built with the default ctor (TextClient.cpp:286 and similar) had garbage in the fields before the caller explicitly assigned them. Add C++11 default member initialisers; the empty ctor body now produces a well-defined zero value. Caught on lint as clang-analyzer-optin.cplusplus.UninitializedObject. - src/ThreadTasks.h + ThreadTasks.cpp -- the EHashes enum had only EH_AICH = 1 and EH_MD4 = 2, but the ctor used (EHashes)(EH_MD4 | EH_AICH), which is value 3, not a member of the enum. Add EH_MD4_AND_AICH = EH_MD4 | EH_AICH as a named member and use it directly, no cast needed. Caught on lint as clang-analyzer-optin.core.EnumCastOutOfRange. - src/PartFileHashThread.cpp -- elapsedMs is computed for a debug log line; AddDebugLogLineN compiles to a no-op in release, so the variable becomes a dead store. wxUnusedVar(elapsedMs) after the macro silences the warning without touching the debug-build output. Caught on lint as clang-analyzer-deadcode.DeadStores. - src/ECSpecialMuleTags.cpp -- the EC_TAG_PREFS_STATISTICS handling block was a placeholder with a //#warning TODO inside and an assignment-form if-statement whose value was overwritten by the next block (real dead store, not a false positive). Drop the assignment, keep the existence check + TODO so future work has an obvious home. Caught on lint as clang-analyzer-deadcode.DeadStores. Out of scope: the RLE.cpp zero-size memset/memcpy warnings on lines 121, 148, 151 (clang-analyzer-core.NonNullParamChecker / uninitialized.Assign / security.ArrayBound). The Decode() function's two-pass realloc dance defeats the analyzer's symbolic execution even after the obvious fixes (allocate at least 1 byte + explicit memset + size guards); the warnings persist because the analyzer follows mathematically-impossible paths through the m_len == 0 branch. A proper fix likely needs an early-return restructure or a switch to std::vector that the analyzer can track better. Deferred. All builds clean across amule, amuled, amulegui, amulecmd on macOS. Re-run of clang-tidy with the amule-project#770 baseline confirms each of the four sites no longer fires; no new warnings introduced.
Closed
1 task
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Jun 4, 2026
…ndex Adds 55+ merged PRs to the 3.0.0 changelog since the last update (amule-project#747, 2026-05-27). Narrative additions cover: - Packaging: expanded the top list to include the macOS per-arch .app bundles and the Windows NSIS installer alongside the existing AppImage / Flatpak / .dmg / .zip entries. New bullets for amule-project#785 (alc/alcc/cas/wxcas everywhere + Windows amuleweb), amule-project#794 (.dmg amuleweb path), amule-project#789 (<OS>-<arch> artifact naming), amule-project#780 / amule-project#796 (Windows DPI + comctl32 manifest), amule-project#784 (FHS share/amule paths). - Bug Fixes & Stability: post-amule-project#744 fixes including EC notification leak (amule-project#797), big-library scaling (amule-project#736, amule-project#840 superseding amule-project#728), amulegui ghost entries (amule-project#810, amule-project#819, amule-project#841, amule-project#824, amule-project#830, amule-project#760), PartFile early hash (amule-project#762), server protocol fixes (amule-project#835, amule-project#788, amule-project#721, amule-project#787), crypto stream UB (amule-project#779), UAF prevention (amule-project#756), Kad rotation (amule-project#795, amule-project#799/amule-project#805), GTK warning silencing (amule-project#833, amule-project#826/amule-project#836), and the clang-tidy worklist (amule-project#770, amule-project#772-amule-project#774). - Translations: late-cycle wave covering French/Turkish manpages (amule-project#753/amule-project#754/amule-project#776), Galician (amule-project#763), Slovenian (amule-project#771), pt-BR (amule-project#768/amule-project#775/amule-project#812), French (amule-project#811), plus man-page tooling for date+version drift (amule-project#802). - Contributors: added ngosang for UX feedback on the late-3.0 cycle (amule-project#817/amule-project#818/amule-project#821/amule-project#828/amule-project#844) and ongoing work on the user-facing manual at amule-org.github.io. - Merged PRs flat index: extended with amule-project#746-amule-project#845 + amule-project#841.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Jun 4, 2026
…ndex Adds 55+ merged PRs to the 3.0.0 changelog since the last update (amule-project#747, 2026-05-27). Narrative additions cover: - Packaging: expanded the top list to include the macOS per-arch .app bundles and the Windows NSIS installer alongside the existing AppImage / Flatpak / .dmg / .zip entries. New bullets for amule-project#785 (alc/alcc/cas/wxcas everywhere + Windows amuleweb), amule-project#794 (.dmg amuleweb path), amule-project#789 (<OS>-<arch> artifact naming), amule-project#780 / amule-project#796 (Windows DPI + comctl32 manifest), amule-project#784 (FHS share/amule paths). - Bug Fixes & Stability: post-amule-project#744 fixes including EC notification leak (amule-project#797), big-library scaling (amule-project#736, amule-project#840 superseding amule-project#728), amulegui ghost entries (amule-project#810, amule-project#819, amule-project#841, amule-project#824, amule-project#830, amule-project#760), PartFile early hash (amule-project#762), server protocol fixes (amule-project#835, amule-project#788, amule-project#721, amule-project#787), crypto stream UB (amule-project#779), UAF prevention (amule-project#756), Kad rotation (amule-project#795, amule-project#799/amule-project#805), GTK warning silencing (amule-project#833, amule-project#826/amule-project#836), and the clang-tidy worklist (amule-project#770, amule-project#772-amule-project#774). - Translations: late-cycle wave covering French/Turkish manpages (amule-project#753/amule-project#754/amule-project#776), Galician (amule-project#763), Slovenian (amule-project#771), pt-BR (amule-project#768/amule-project#775/amule-project#812), French (amule-project#811), plus man-page tooling for date+version drift (amule-project#802). - Contributors: added ngosang for UX feedback on the late-3.0 cycle (amule-project#817/amule-project#818/amule-project#821/amule-project#828/amule-project#844) and ongoing work on the user-facing manual at amule-org.github.io. - Merged PRs flat index: extended with amule-project#746-amule-project#845 + amule-project#841.
mrjimenez
pushed a commit
that referenced
this pull request
Jun 4, 2026
Adds 55+ merged PRs to the 3.0.0 changelog since the last update (#747, 2026-05-27). Narrative additions cover: - Packaging: expanded the top list to include the macOS per-arch .app bundles and the Windows NSIS installer alongside the existing AppImage / Flatpak / .dmg / .zip entries. New bullets for #785 (alc/alcc/cas/wxcas everywhere + Windows amuleweb), #794 (.dmg amuleweb path), #789 (<OS>-<arch> artifact naming), #780 / #796 (Windows DPI + comctl32 manifest), #784 (FHS share/amule paths). - Bug Fixes & Stability: post-#744 fixes including EC notification leak (#797), big-library scaling (#736, #840 superseding #728), amulegui ghost entries (#810, #819, #841, #824, #830, #760), PartFile early hash (#762), server protocol fixes (#835, #788, #721, #787), crypto stream UB (#779), UAF prevention (#756), Kad rotation (#795, #799/#805), GTK warning silencing (#833, #826/#836), and the clang-tidy worklist (#770, #772-#774). - Translations: late-cycle wave covering French/Turkish manpages (#753/#754/#776), Galician (#763), Slovenian (#771), pt-BR (#768/#775/#812), French (#811), plus man-page tooling for date+version drift (#802). - Contributors: added ngosang for UX feedback on the late-3.0 cycle (#817/#818/#821/#828/#844) and ongoing work on the user-facing manual at amule-org.github.io. - Merged PRs flat index: extended with #746-#845 + #841.
got3nks
pushed a commit
to got3nks/amule
that referenced
this pull request
Aug 3, 2026
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
Third cleanup pass from the worklist on #766, addressing the latent-but-tidy items the analyzer surfaces:
src/libs/ec/cpp/ECTag.hEC_IPv4_tdefault ctor leftm_ipandm_portuninitialised; default member initialisers cover the trivial ctoroptin.cplusplus.UninitializedObjectsrc/ThreadTasks.{h,cpp}EHasheslacked the bitwise-combined value 3, but the ctor cast to it; addedEH_MD4_AND_AICHmember and used it directlyoptin.core.EnumCastOutOfRangesrc/PartFileHashThread.cppelapsedMsis dead in release whereAddDebugLogLineNis a no-op;wxUnusedVarafter the macrodeadcode.DeadStoressrc/ECSpecialMuleTags.cppEC_TAG_PREFS_STATISTICSplaceholder block used an assignment-formifwhose value was overwritten by the next block; dropped the assignment, kept the existence check + TODOdeadcode.DeadStoresOut of scope
The
RLE.cpp:121/148/151zero-size NULL-op warnings are intentionally left for a follow-up. TheDecode()function's two-pass realloc dance defeats the analyzer's symbolic execution even after the obvious shape (allocate at least 1 byte + explicit memset + size guards) — it follows mathematically-impossible paths through them_len == 0branch. A real fix likely needs an early-return restructure or a switch tostd::vectorthat the analyzer can track. Deferred so this PR stays focused.Test plan
Depends on #770 for the baseline config that surfaced this worklist.