bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] sha512-buffer: port back to 32-bit-only hosts


From: Paul Eggert
Subject: Re: [PATCH] sha512-buffer: port back to 32-bit-only hosts
Date: Sun, 19 May 2024 08:03:38 -0700
User-agent: Mozilla Thunderbird

On 2024-05-18 20:42, Collin Funk wrote:
Out of personal interest, do you happen to know what platforms Emacs
builds on that lack 64-bit types?

Emacs is a bit of a special case as it builds on verrry ooold platforms, including platforms no longer supported by their suppliers, and we're reasonably reluctant to require uint64_t except in platform-specific code where we know it's available. For example, there have been fairly recent (circa 2023) additions to Emacs working around the lack of uint64_t on older Android in certain compilation environments. For an example of these old environment's hassles (having to do with c89 vs c99 compatibility, ouch), see <https://cs.android.com/android/_/android/platform/bionic/+/6d6731adc0cd0fb249a2b73a575e5ab2204643cc> which indicates this was an issue through at least Android Jelly Bean (2012), and I think the problem was even worse in earlier Android versions.

For what it's worth, in theory one must be careful with all the uint*_t types, as the standards say that integer overflow can have undefined behavior with any of them (because in theory they could all fit in 'int'). One can use stdckdint.h macros to work around this theoretical issue, but of course that's annoying. I often find it easier just to use 'unsigned int' or something wider.



reply via email to

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