Re: [PATCH] notmuch-show: use correct format specifier for ssize_t

Subject: Re: [PATCH] notmuch-show: use correct format specifier for ssize_t

Date: Tue, 02 Feb 2021 19:52:20 +0200

To: David Bremner, Đoàn Trần Công Danh, notmuch@notmuchmail.org

Cc: Đoàn Trần Công Danh

From: Tomi Ollila


On Mon, Feb 01 2021, David Bremner wrote:

> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
>
>> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
>> ---
>>
>>  I found this after inspecting one of my build today.
>>  I'm not sure what is acceptable action.
>>  I think using %zd is the right move.
>>  But I'm not sure if you prefer to case ssize to long int.
>>
>
> If I understand correctly %zd is glibc specific? Is there a more portable way
> to do this? Maybe that's what you meant by the cast.

printf(3) is not too clear about that, In one place I understand
%z is "SUSv3" compatible (what that says is something vague, perhaps just
post C99), and in one place it says glibc 2.1 adds support for 'z' (but
perhaps since it is in standard already) 

Anyway, based on that I'd say %zd is standard compliant enough.

Tomi
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: