[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: intptr_t vs. uintptr_t
From: |
Paul Eggert |
Subject: |
Re: intptr_t vs. uintptr_t |
Date: |
Mon, 16 Dec 2019 02:02:46 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 12/14/19 4:35 PM, Bruno Haible wrote:
> the advice can be simplified: If pointer arithmetic
> is involved, uintptr_t is better suited than intptr_t. And if pointer
> arithmetic
> is not involved, uintptr_t and intptr_t are equivalent and equally good.
It's more complicated in Emacs, because Emacs sometimes converts small integers
to pointers and then back again, and these integers can be negative. (The C
standard doesn't guarantee that this works, but Emacs is deliberately
nonportable in this low-level area and it does work on Emacs's current
platforms.) For such conversions, signed integers are more convenient.
It is a messy area, admittedly.
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, (continued)
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, Paul Eggert, 2019/12/12
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, arnold, 2019/12/13
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, arnold, 2019/12/13
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, Jim Meyering, 2019/12/13
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, Paul Eggert, 2019/12/13
- Re: intptr_t vs. uintptr_t, Bruno Haible, 2019/12/13
- Re: intptr_t vs. uintptr_t, Paul Eggert, 2019/12/13
- Re: intptr_t vs. uintptr_t, Bruno Haible, 2019/12/14
- Re: intptr_t vs. uintptr_t, Paul Eggert, 2019/12/14
- Re: intptr_t vs. uintptr_t, Bruno Haible, 2019/12/14
- Re: intptr_t vs. uintptr_t,
Paul Eggert <=
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, arnold, 2019/12/15
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, Paul Eggert, 2019/12/16
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, arnold, 2019/12/16
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, Paul Eggert, 2019/12/19
- Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher, arnold, 2019/12/20