bug-texinfo
[Top][All Lists]
Advanced

[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.



reply via email to

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