emacs-devel
[Top][All Lists]
Advanced

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

Re: ptrdiff_t misuse


From: Chong Yidong
Subject: Re: ptrdiff_t misuse
Date: Sat, 07 Jul 2012 09:31:27 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> If this is indeed the reason, I suggest a new typedef:
>
>   typedef ptrdiff_t EMACS_POS;
>
> to be used with all such variables.  I think this will contribute to
> clarity of the code, since ptrdiff_t is a rarely-used type, and thus I
> expect many programmers to be unfamiliar with it.  By contrast,
> EMACS_POS by its very name tells what the variable can and cannot
> hold.

This is a bad idea.  Since EMACS_POS would occur rarely in the code, it
would be necessary to look up what it means when you stumble across it.
It would be easier to simply remember the meaning and use of ptrdiff_t.
Introducing yet another type defeats the purpose.




reply via email to

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