emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferring ptrdiff_t to ssize_t


From: Eli Zaretskii
Subject: Re: Preferring ptrdiff_t to ssize_t
Date: Thu, 02 Oct 2014 05:54:32 +0300

> Date: Wed, 01 Oct 2014 13:29:40 -0700
> From: Paul Eggert <address@hidden>
> 
> I'm bringing this up now because in emacs-24 bzr 117515 Eli introduced a 
> ssize_t local variable, in trunk bzr 117993 I changed it to ptrdiff_t, 
> and Eli reverted the latter change in trunk bzr 117997.  In this 
> particular case the value happens to be an 'int', so on second thought 
> perhaps Emacs should just declare it as 'int' rather than mess with *_t 
> types.

I reverted it because your change was motivated by purely stylistic
reasons in that particular case.  The value in question is being
passed to realloc, which accepts an argument of type size_t.  I needed
a signed type of the same width, so I've chosen ssize_t.  I don't see
any problems with that in this particular case, even if we accept your
suggested general preference of ptrdiff_t, and this single case
doesn't change in any way our factual preferences, which are quite
clear from looking at the sources.

More generally, I wish you'd discuss these issues before making
changes, not after.  But I guess this is a moot point.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]