Re: [PATCH v3] utf8: make utf8_strwidth() and utf8_strnwidth() return size_t
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 27, 2026, 14:55 UTC
- Message-ID
- <xmqq4ihkpjn3.fsf@gitster.g>
- In-Reply-To
- <e971400e-6d23-463f-ae9c-a21d3c5a3563@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 5 quoted lines
> I think it would be much better to remove the TODO comment as Junio > previously suggested and instead add some documentation to the function > explaining (a) why it is appropriate for it to return an int; (b) why we > must use the cast_size_t_to_int() helper to prevent overflows (see the > commit that added that comment).
Thanks, especially for (b) above. That needs to be stressed if we are to go in that direction.