RRichard Russonbugprone: parenthesize macro arguments/replacement lists
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
Dont' mix Content-ID with parameters (#4330) Fixes #4327 | 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. | 4 个月前 | |
cmd: move tag-formats,-transforms to email | 6 个月前 | |
relocate config options Move 65 config items and their data out of mutt_config.c | 7 个月前 | |
tidy code - fix typos - fix doxygen headers - fix whitespace - fix #includes | 1 年前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
move mutt_body.c to libemail | 7 个月前 | |
fix bool-like conditions Many functions return 0/-1 for success/failure. Check their return values explicitly for clarity. | 4 个月前 | |
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. | 4 个月前 | |
rename email_size() Rename email_size() to email_get_size() to avoid a clash with the Expando callbacks. | 1 年前 | |
expando: rename some uids Rename some Expando UIDs for consistency. - ED_EMA_STRF -> ED_EMA_DATE_STRF - ED_EMA_STRF_LOCAL -> ED_EMA_DATE_STRF_LOCAL - ED_FOL_STRF -> ED_FOL_DATE_STRF - ED_GLO_CERTIFICATE_PATH -> ED_SMI_CERTIFICATE_PATH - ED_GLO_SORT -> ED_GLO_CONFIG_SORT - ED_GLO_SORT_AUX -> ED_GLO_CONFIG_SORT_AUX - ED_GLO_USE_THREADS -> ED_GLO_CONFIG_USE_THREADS - ED_PAT_EXPRESION -> ED_PAT_EXPRESSION | 1 年前 | |
fix: avoid LOFF_T/long narrowing in text_enriched_handler b_email->length is LOFF_T (off_t), copied into a local long. Both are 64-bit on every platform NeoMutt targets, so this is harmless in practice, but it's not guaranteed by the C standard and the local variable should match the field it's read from. Coverity CID 535655. | 1 个月前 | |
move enriched.c to libemail | 7 个月前 | |
initialise things Ensure that pointers, structs and variables used as outparams are initialised. (some of variable types were obscured by typedefs) | 2 个月前 | |
mlist: move list dialog into its own library The Mailing-list Action Dialog, dlg_list(), is an independent Dialog, so give it its own directory. | 3 个月前 | |
update copyright dates | 2 年前 | |
update copyright dates | 2 年前 | |
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> | 1 个月前 | |
move handler.c to libemail | 7 个月前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
move mutt_header.c to libemail | 7 个月前 | |
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. | 4 个月前 | |
cmd: move group,ignore,spam to email Move commands into libemail - group - ignore - nospam - score - spam - ungroup - unignore - unscore | 6 个月前 | |
move group.[ch] from email/ to alias/ | 4 个月前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 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. | 4 个月前 | |
Remove "." from MimeSpecials (RFC2045 tspecials) RFC2045 declares tspecials to not include a period. So encoding it inside 2231 parameter values, or adding double quotes to MIME parameter values (such as in Content-Type and Content-Disposition) because of the presence of a period, while not illegal, is unnecessary. Ticket 491 reported a case where some Android clients were not decoding the "." in an attachment filename extension for some unknown reason. While this is clearly a bug in the Android client, it's also true that the period need not have been encoded in the first place. However, "." couldn't simply be removed from MIMESpecials, because it was also used for RFC2047 encoding. RFC2047 encoded-words are used in non-MIME headers, and cannot be double quoted. Create a third "specials" list, RFC2047Specials, adding back in the ".", to keep RFC2047 encoding the same as it was. Add a comment as to why it exists, to prevent someone from making the unfortunate mistake of thinking it can just be changed back to use MIMESpecials. Upstream-commit: cba1fc27b | 4 个月前 | |
bugprone: parenthesize macro arguments/replacement lists The last of the three categories flatcap flagged as good candidates on #4970 -- bugprone-macro-parentheses. 28 sites across 13 files fixed; 7 confirmed as genuine false positives and deliberately left untouched (see below). Every site was checked against its actual call sites for a live bug, not just mechanically wrapped: - Simple negative-constant macros (COLOR_DEFAULT, MUTT_WIN_SIZE_UNLIMITED, OP_REPAINT/TIMEOUT/ABORT, IMAP_RES_NO/BAD, MUTT_MAXRANGE) get their replacement list wrapped. - Value-expression arguments used unparenthesized next to an operator (config/types.h's IS_MAILBOX/IS_COMMAND, mutt/array.h's ARRAY_GET, mutt/mbyte.h's IsWPrint/IsBOM, notmuch/private.h's LIBNOTMUCH_CHECK_VERSION) get the argument wrapped -- no live caller currently passes a compound expression, but this is exactly the class of bug that bites the next caller who does. - mutt/string2.h's SKIPWS and mutt/array.h's ARRAY_FOREACH_(REVERSE_)FROM_TO wrap the argument even though it's used as an assignment/increment target, since `(x)++`/`(x) = ...` are equivalent to the unparenthesized form for any valid lvalue -- harmless, satisfies the check. Three false-positive patterns confirmed and left alone, since parenthesizing would either not compile or change meaning: - mutt/atoi.h:39 and mutt/memory.h:57: the macro argument is a type name (a function parameter's type, and a _Generic type-association respectively), not a value expression -- wrapping a type name in parens isn't valid there. - mutt/array.h:52: same class -- `T` is the array element's type name in a struct member declaration. - mutt/queue.h:437/632/887/896 (all four remaining sites in that file): `field` is passed as a member-designator into `__containerof()` (built on `offsetof()`), not a value expression. Verified empirically with a standalone test file: parenthesizing a member-designator argument to `offsetof()` is a genuine compile error ("expected identifier"), not just a style question. Verification: `clang-tidy -p . <file> --checks='-*,bugprone-macro-parentheses' --header-filter='.*'` now reports only the 7 confirmed-false-positive sites above (was 28 fixable + 7 false positives = 35 total unique locations). Full clean build, `make test` passes (all suites), `clang-format --dry-run -Werror` shows no *new* violations in any changed file (checked differentially against each file's pre-existing state, since several of these headers already had unrelated formatting drift). AI assistance: the mechanical location of all sites, the call-site tracing to distinguish live risk from defensive-only fixes, and the identification + empirical verification of the false positives was done by Claude Code; I reviewed the reasoning and diff, including the compile-error test for the offsetof() case, before this went up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> | 1 个月前 | |
module: tidy cleanup Pass the Module Data to the Module on cleanup() | 4 个月前 | |
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. | 4 个月前 | |
Use MUTT_MEM_CALLOC() Reviewed-by: Pietro Cerutti <gahr@gahr.ch> Signed-off-by: Alejandro Colomar <alx@kernel.org> | 1 年前 | |
update copyright dates | 2 年前 | |
parse: fix out-of-bounds read in parse_references mutt_extract_message_id() reports the message-id offset within the rfc2047-decoded copy, but parse_references() advances the raw header by it. An encoded-word in a charset that expands to UTF-8 makes the decoded text longer, so the read pointer walks past the header buffer. Decode the header once and iterate over that copy. | 1 个月前 | |
iwyu: fix includes | 3 个月前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
update copyright dates | 2 年前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
update copyright dates | 2 年前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
move rfc3676.c to libemail | 7 个月前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
email: move globals to EmailModuleData - Add score_list to struct EmailModuleData - Update score.c functions to use mod_data - Remove extern from score.h | 4 个月前 | |
split up variable definitions clang-tidy warns: 'warning: multiple declarations in a single statement reduces readability' | 2 个月前 | |
docs: update help for sort options - Fix the options for $alias_sort - Unify the tables of sort values | 10 个月前 | |
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. | 4 个月前 | |
cmd: move group,ignore,spam to email Move commands into libemail - group - ignore - nospam - score - spam - ungroup - unignore - unscore | 6 个月前 | |
module: rename vars to mod_data - rename local ModuleData variables to mod_data across active code - update placeholder commented module stubs to use the same name - keep non-ModuleData fields such as menu->mdata unchanged | 4 个月前 | |
module: rename vars to mod_data - rename local ModuleData variables to mod_data across active code - update placeholder commented module stubs to use the same name - keep non-ModuleData fields such as menu->mdata unchanged | 4 个月前 | |
update copyright dates | 2 年前 | |
update copyright dates | 2 年前 | |
initialise things Ensure that pointers, structs and variables used as outparams are initialised. (some of variable types were obscured by typedefs) | 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. | 4 个月前 |