emacs-devel
[Top][All Lists]
Advanced

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

Re: EMACS_INT to EMACS_UINT


From: Daniel Colascione
Subject: Re: EMACS_INT to EMACS_UINT
Date: Mon, 5 Dec 2016 09:47:34 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 12/05/2016 09:23 AM, Paul Eggert wrote:
On 12/05/2016 05:56 AM, Ravi Desai wrote:
I was thrown off by the lack of explicit casting.

All other things being equal I prefer ordinary assignment to explicit
casting when either will do. That way, the compiler is more likely to
catch typos.

C++'s cast operators are be useful here --- for example, const_cast lets you cast a variable from const foo* to a foo* without inadvertently casting a foo* to a bar* if the type of the variable changes to const bar*.

The GDB people are slowly migrating their C-style codebase to C++, and without turning it into a a GoF book appendix. Maybe we can do the same someday.



reply via email to

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