On Saturday, 16 August 2025 at 23:32:00 UTC, Richard (Rikki) Andrew Cattermole wrote:

On 17/08/2025 11:21 AM, Ali Çehreli wrote:
On 8/16/25 8:44 AM, Brother Bill wrote:

 > [...]
past the end of
 > [...]

I am the author. I have no problem with that part of the book: The quote is correct.

Both C and C++ explicitly state what I wrote above. That guarantee is necessary so that looping over the elements of an array does not make the program illegal just because the array may be sitting at the end of an allocated page.

D does not reject that part of C's memory model.

Ali

We in fact do reject it.

"When a pointer to T is dereferenced, it must either have a null value, or point to a valid instance of type T."

"Undefined Behavior: dereferencing a pointer that is not null and does not point to a valid instance of type T."

https://dlang.org/spec/type.html#pointers

Op was clear from the beginning that this isn't about dereferencing but mere existence. Doubt any one is confused about dereferencing crash'n.
              • ... monkyyy via Digitalmars-d-learn
              • ... 0xEAB via Digitalmars-d-learn
              • ... 0xEAB via Digitalmars-d-learn
              • ... Brother Bill via Digitalmars-d-learn
              • ... Monkyyy via Digitalmars-d-learn
              • ... Brother Bill via Digitalmars-d-learn
              • ... Monkyyy via Digitalmars-d-learn
              • ... Monkyyy via Digitalmars-d-learn
              • ... Ali Çehreli via Digitalmars-d-learn
              • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... Monkyyy via Digitalmars-d-learn
  • Re: Pointers - I... Monkyyy via Digitalmars-d-learn
  • Re: Pointers - I... Paul Backus via Digitalmars-d-learn
    • Re: Pointer... Andy Valencia via Digitalmars-d-learn
      • Re: Poi... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Poi... monkyyy via Digitalmars-d-learn
      • Re: Poi... H. S. Teoh via Digitalmars-d-learn
      • Re: Poi... Paul Backus via Digitalmars-d-learn
        • Re:... monkyyy via Digitalmars-d-learn
        • Re:... Ali Çehreli via Digitalmars-d-learn

Reply via email to