[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: integer types
From: |
Gavin Smith |
Subject: |
Re: integer types |
Date: |
Wed, 5 Apr 2023 15:52:22 +0100 |
On Wed, Apr 05, 2023 at 05:14:03PM +0300, Eli Zaretskii wrote:
> > From: Gavin Smith <gavinsmith0123@gmail.com>
> > Date: Wed, 5 Apr 2023 14:59:23 +0100
> > Cc: pertusus@free.fr, arash@gnu.org, bug-texinfo@gnu.org
> >
> > Might it be better to round-trip through intptr_t rather than through
> > a pointer type?
>
> Yes, I think this will be better. Cleaner, too.
Done in commit d58abbbb85.
> > I've never heard of that before. So you are saying if you have a small
> > integer (like 5) stored in a narrow integer type, cast this to a wider
> > pointer type, and then cast it back to the same integer type, then
> > something catastrophic happens? How does that work?
>
> If the pointer is to a narrower type, then dereferencing it will take
> only part of the bits of the integer value. Depending on the
> endianness, that part could be the LSB (good) or MSB (bad).
We were never dereferencing the pointer as it made no sense as a pointer,
only as an integer.
- [PATCH] Silence compiler warnings with MinGW64, Arash Esbati, 2023/04/05
- Re: [PATCH] Silence compiler warnings with MinGW64, Eli Zaretskii, 2023/04/05
- Re: [PATCH] Silence compiler warnings with MinGW64, Patrice Dumas, 2023/04/05
- Re: [PATCH] Silence compiler warnings with MinGW64, Eli Zaretskii, 2023/04/05
- integer types, Gavin Smith, 2023/04/05
- Re: integer types, Eli Zaretskii, 2023/04/05
- Re: integer types, Gavin Smith, 2023/04/05
- Re: integer types, Eli Zaretskii, 2023/04/05
- Re: integer types,
Gavin Smith <=
- Re: integer types, Andreas Schwab, 2023/04/05
Re: [PATCH] Silence compiler warnings with MinGW64, Gavin Smith, 2023/04/05
- Re: [PATCH] Silence compiler warnings with MinGW64, Arash Esbati, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Gavin Smith, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Eli Zaretskii, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Arash Esbati, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Eli Zaretskii, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Gavin Smith, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Arash Esbati, 2023/04/06
- Re: [PATCH] Silence compiler warnings with MinGW64, Arash Esbati, 2023/04/06