Paul Eggert wrote:
> > uintN_t arithmetic is overflow-free, just like 'unsigned int' arithmetic.
>
> Not exactly. For example, this:
>
>uint16_t a = 46341, b = a * a;
>
> has undefined behavior on typical platforms with 32-bit int, because
> 46341*46341 exceeds 2**31 - 1. Although many prog
On 2024-05-19 14:37, Bruno Haible wrote:
uintN_t arithmetic is overflow-free, just like 'unsigned int' arithmetic.
Not exactly. For example, this:
uint16_t a = 46341, b = a * a;
has undefined behavior on typical platforms with 32-bit int, because
46341*46341 exceeds 2**31 - 1. Although man
Hi Paul,
> > 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
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
reasona
Collin Funk wrote:
> Out of personal interest, do you happen to know what platforms Emacs
> builds on that lack 64-bit types?
This would have been my question as well. Because we are assuming the
presence of 'long long' since 2019-12-22 [1], and 'long long' is
64-bits wide everywhere. I thought th
Hi Paul,
Patch looks good.
On 5/18/24 7:04 PM, Paul Eggert wrote:
> Port to platforms lacking 64-bit integers (something that Emacs
> still attempts to do, in theory) by adding an u64bswap primitive
> to u64.h and using that, instead of using bswap_64. This fixes a
> bug I made in commit 0d45ec7
Port to platforms lacking 64-bit integers (something that Emacs
still attempts to do, in theory) by adding an u64bswap primitive
to u64.h and using that, instead of using bswap_64. This fixes a
bug I made in commit 0d45ec7c033c165ad73a6509c7fa84aa67edf4ea
dated Sun Jun 17 14:35:37 2018 -0700.
* li