emacs-devel
[Top][All Lists]
Advanced

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

Re: Dynamic loading progress


From: Paul Eggert
Subject: Re: Dynamic loading progress
Date: Thu, 19 Nov 2015 16:03:30 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 11/19/2015 03:57 PM, Philipp Stephani wrote:
Thanks. I saw you changed some other members to ptrdiff_t (the public size members of emacs_runtime and emacs_env), is that intentional, and if so, what is the reason?

As a general rule, in Emacs source code we prefer signed arithmetic to unsigned, because the latter is so error prone when it comes to comparisons. Also, signed arithmetic allows for better low-level checking, e.g., with -fsanitize=undefined. (There are a few exceptions, e.g., hash values, but they're relatively rare.) So the module interface should encourage the use of signed integer arithmetic when possible.

It might also be useful to support modules that, for whatever reason, cannot deal with signed integers and must use unsigned integers. That could be something we add later, if necessary.

Anyway, emacs-module.h now lacks an #include <stddef.h>.

Thanks, fixed now.



reply via email to

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