Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #163969

Re: on understanding & and pointer arithmetic

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.lang.c
Subject Re: on understanding & and pointer arithmetic
Date 2021-12-18 18:56 +0100
Organization A noiseless patient Spider
Message-ID <spl7cj$3kl$1@dont-email.me> (permalink)
References (2 earlier) <8635msbbcu.fsf@levado.to> <spg6b8$on0$1@dont-email.me> <87a6h08e4a.fsf@nosuchdomain.example.com> <sphmnl$vuo$1@dont-email.me> <86czlu7zap.fsf@levado.to>

Show all headers | View raw


On 18/12/2021 15:39, Meredith Montgomery wrote:

> 
> It's also nice to see that the situation is even deeper than I would
> have thought, though.  For instance, right now my intuition is that the
> size of a pointer on a 64-bit machine is always 8 bytes.  Can anyone
> show an easy example of when this isn't true?
> 

There is the x32 ABI, which is an alternative ABI for 64-bit x86 systems
that uses 32-bit pointers but 64-bit integer registers and the
additional features and registers that x86-64 provides beyond x86-32.
The result was more efficient for some kinds of code, but it never
really took off.  Some Linux distributions provide support for it (such
as libraries) alongside their main 64-bit stuff.

There are also a few systems, mostly historic and/or academic, that have
wider pointers containing security or protection information in addition
to addresses.

It is usually in smaller systems and nice areas (like DSPs) that you
have unusual sizes.  For example, gcc for the the 8-bit AVR
microcontroller family has 16-bit int, 16-bit pointers for data and code
that are separate address spaces (i.e., a data pointer and a function
pointer could contain the same "value" if you were to cast them to a
uintptr_t, yet, point to completely different memory locations).  It
also has 24-bit code pointers, and 24-bit generic pointers as well.
This is the best example I know of for strangely sized and incompatible
pointers, in devices that are popular and modern.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-16 11:13 -0300
  Re: on understanding & and pointer arithmetic Bart <bc@freeuk.com> - 2021-12-16 14:23 +0000
    Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-16 11:57 -0300
      Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 17:42 +0000
        Re: on understanding & and pointer arithmetic Bart <bc@freeuk.com> - 2021-12-16 18:14 +0000
          Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 21:14 +0000
        Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-16 16:42 -0300
          Re: on understanding & and pointer arithmetic Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-12-16 12:44 -0800
            Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:06 -0300
          Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 21:34 +0000
            Re: on understanding & and pointer arithmetic Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-12-16 14:14 -0800
              Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 23:44 +0000
            Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:09 -0300
  Re: on understanding & and pointer arithmetic David Brown <david.brown@hesbynett.no> - 2021-12-16 16:23 +0100
    Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-16 16:25 -0300
      Re: on understanding & and pointer arithmetic David Brown <david.brown@hesbynett.no> - 2021-12-16 21:08 +0100
        Re: on understanding & and pointer arithmetic Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-12-16 12:54 -0800
          Re: on understanding & and pointer arithmetic David Brown <david.brown@hesbynett.no> - 2021-12-17 10:53 +0100
            Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 11:39 -0300
              Re: on understanding & and pointer arithmetic scott@slp53.sl.home (Scott Lurndal) - 2021-12-18 16:31 +0000
              Re: on understanding & and pointer arithmetic David Brown <david.brown@hesbynett.no> - 2021-12-18 18:56 +0100
                Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-25 21:29 -0300
              Re: on understanding & and pointer arithmetic Bart <bc@freeuk.com> - 2021-12-18 18:29 +0000
        Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 11:32 -0300
    Re: on understanding & and pointer arithmetic Manfred <noname@add.invalid> - 2021-12-16 21:34 +0100
      Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 22:20 +0000
        Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:02 -0300
          Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:34 -0300
          Re: on understanding & and pointer arithmetic Manfred <noname@add.invalid> - 2021-12-18 18:36 +0100
          Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-18 21:17 +0000
      Re: on understanding & and pointer arithmetic James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-12-16 18:59 -0500
  Re: on understanding & and pointer arithmetic James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-12-16 18:38 -0500
    Re: on understanding & and pointer arithmetic Bart <bc@freeuk.com> - 2021-12-16 23:50 +0000
      Re: on understanding & and pointer arithmetic "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2021-12-17 07:34 -0800
        Re: on understanding & and pointer arithmetic Bart <bc@freeuk.com> - 2021-12-17 17:48 +0000
    Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-16 23:56 +0000
      Re: on understanding & and pointer arithmetic James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-12-16 19:06 -0500
        Re: on understanding & and pointer arithmetic Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-17 00:10 +0000
        Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:32 -0300
    Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:30 -0300
  Re: on understanding & and pointer arithmetic David Brown <david.brown@hesbynett.no> - 2021-12-17 11:08 +0100
    Re: on understanding & and pointer arithmetic Manfred <noname@add.invalid> - 2021-12-17 16:24 +0100
      Re: on understanding & and pointer arithmetic David Brown <david.brown@hesbynett.no> - 2021-12-17 18:17 +0100
    Re: on understanding & and pointer arithmetic Meredith Montgomery <mmontgomery@levado.to> - 2021-12-18 12:11 -0300

csiph-web