RRichard Russonbugprone: add default cases for switch-missing-default-case
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 3 个月前 | |
update copyright dates | 2 年前 | |
refactor: upgrade macro flags to enum flags Turn #define'd flags into enums. Enums provide: - debugger visibility - compiler diagnostics - symbol scoping by convention - easier navigation/search - cleaner documentation generation - type grouping Naming: - enum has singular ending, e.g. Flag - typedef wrapper has plural ending, e.g. Flags Suffix `_NO_FLAGS` has been renamed to `_NONE` for consistency. | 5 个月前 | |
unify capitalisation of Message-ID | 6 个月前 | |
send: rename greeting_expando.c Rename a file to accommodate another expando file. - send/expando.c -> send/greeting_expando.c | 9 个月前 | |
send: rename greeting_expando.c Rename a file to accommodate another expando file. - send/expando.c -> send/greeting_expando.c | 9 个月前 | |
refactor: upgrade macro flags to enum flags Turn #define'd flags into enums. Enums provide: - debugger visibility - compiler diagnostics - symbol scoping by convention - easier navigation/search - cleaner documentation generation - type grouping Naming: - enum has singular ending, e.g. Flag - typedef wrapper has plural ending, e.g. Flags Suffix `_NO_FLAGS` has been renamed to `_NONE` for consistency. | 5 个月前 | |
unify capitalisation of Message-ID | 6 个月前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 3 个月前 | |
move copy.c to libemail | 8 个月前 | |
cmd: move my-header to send | 7 个月前 | |
module: tidy cleanup Pass the Module Data to the Module on cleanup() | 5 个月前 | |
module: add Notify object to each globals Add a 'struct Notify *notify' member to every ModuleData struct. Create it with notify_new() in each Module.init() function, set its parent to NeoMutt->notify, and free it in Module.cleanup(). For modules that previously had commented-out init/cleanup code, uncomment the mod_data allocation and deallocation. | 5 个月前 | |
initialise things Ensure that pointers, structs and variables used as outparams are initialised. (some of variable types were obscured by typedefs) | 3 个月前 | |
create libsend for outgoing mail | 6 年前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 3 个月前 | |
cmd: move my-header to send | 7 个月前 | |
bugprone: add default cases for switch-missing-default-case Fixes the second of the three categories flatcap flagged as good candidates on #4970 (55 sites across 33 files, matching his count exactly). Each switch was read in full to determine the semantically correct default, not just silenced mechanically: - Most are op/command dispatchers or menu-choice switches (event->op, mw_multi_choice() results, single-letter responses) where the existing code already has an implicit fallback after the switch (a later return, or falling through to shared code) -- these get `default: break;` to make that explicit without changing behaviour. - A few (external.c, muttlib.c, send/send.c) explicitly mirror the existing "abort" case's behaviour, since leaving the loop/function state unchanged on an impossible value would otherwise risk an infinite loop or a silently-wrong return. - pattern/exec.c's two large op-table dispatchers already had an explicit "unknown op" error path after the switch; the new default falls through to it, matching the existing intent exactly. - A handful (pop/auth.c, pop/lib.c, pop/pop.c) switch on documented function return codes; checked each callee's own @retval doc comment to confirm every case was genuinely covered, and matched the default to whichever existing case already represents "no specific outcome" for that function. No case does more than reproduce behaviour the code already had implicitly -- this is a defensiveness/documentation change, not a behaviour change. Verification: `clang-tidy -p . <file> --checks='-*,bugprone-switch-missing-default-case'` now reports 0 warnings across all 55 sites (was 55). Full clean build, `make test` passes (all suites), `clang-format --dry-run -Werror` clean on every changed file (one pre-existing, unrelated violation in autocrypt/gpgme.c confirmed via `git stash` before and after -- not introduced by this change). AI assistance: mechanical location of all 55 sites and the semantic analysis of each switch (tracing callee return contracts, existing fallback behaviour, and loop-safety implications) was done by Claude Code; I reviewed the reasoning and diff before this went up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> | 2 个月前 | |
refactor: upgrade macro flags to enum flags Turn #define'd flags into enums. Enums provide: - debugger visibility - compiler diagnostics - symbol scoping by convention - easier navigation/search - cleaner documentation generation - type grouping Naming: - enum has singular ending, e.g. Flag - typedef wrapper has plural ending, e.g. Flags Suffix `_NO_FLAGS` has been renamed to `_NONE` for consistency. | 5 个月前 | |
bugprone: replace rewind()/setbuf() with checked equivalents rewind() and setbuf() give clang-tidy's bugprone-unsafe-functions check no way to detect failure. Replace with their exact behavioural equivalents that do: fseek()+clearerr() for rewind() (fseek alone doesn't clear the error indicator the way rewind() does), and setvbuf() for the one setbuf() call. Three sites (nntp.c, crypt_gpgme.c, smime.c) had the original rewind() as an unbraced single-statement if-body; braces added where the two-statement replacement needed them, since one would otherwise silently run unconditionally. Doesn't add explicit fseek()/setvbuf() return-value checking beyond what the codebase already does at nearby call sites -- that would be a separate, larger error-handling question, not addressed here. Confirmed via `clang-tidy -p . <file> --checks='-*,bugprone-unsafe-functions'` this clears all 76 warnings flatcap found on PR #4970 in this category. Full clean build and `make test` pass. AI assistance: written and verified by Claude Code (mechanical transform + manual review of all 76 sites for the brace hazard above), reviewed by chrisdebian before commit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> | 2 个月前 | |
doxy: comments lots of #defines | 8 个月前 | |
fix: free tempfile string on send_msg()'s outer fork() failure If the outer fork() fails (pid == -1), execution fell straight past the if (pid == 0) child-only block -- where every other failure path frees the tempfile string allocated just before the fork -- so the string leaked on this one path. fork() only fails under severe resource exhaustion, so this is narrow and low-severity, but it's a real, confirmed leak. Coverity CID 76964. | 2 个月前 | |
update copyright dates | 2 年前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 3 个月前 | |
drop config.h from headers only need it where there's a #if dependency or where config.h defines something like OFF_T | 8 个月前 |