[vim/vim] patch 9.2.NNNN: string macros silently accept a size of the wrong type (PR #20656)

1 view
Skip to first unread message

Shane Harper

unread,
Jun 27, 2026, 9:56:30 PM (11 hours ago) Jun 27
to vim/vim, Subscribed

Problem: Several string and memory wrapper macros cast their size
argument to size_t although the wrapped function's prototype
already declares that parameter size_t; such casts silence the
warning a compiler would otherwise give when a value of the
wrong type, such as a pointer, is passed as the size.
Solution: Where the wrapped function's prototype already declares the
parameter size_t, remove the cast so that a size argument of
the wrong type can be reported at compile time (K.Takata,
Shane Harper).

From gcc 14 on, -Wint-conversion is an error by default.

With gcc, passing a signed value where size_t is expected triggers -Wsign-conversion, but the check is off by default and the build already emits many such warnings.

related: #20642


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20656

Commit Summary

  • 349f589 patch 9.2.NNNN: string macros silently accept a size of the wrong type

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20656@github.com>

Reply all
Reply to author
Forward
0 new messages