On Saturday, 16 August 2025 at 11:56:43 UTC, Brother Bill wrote:
It is obvious that reading or writing to invalid memory can result in "undefined behavior".
But is merely pointing to invalid memory "harmful"?

The documentation states that going one past the last element of a slice is acceptable. But is it also safe to go 10, 100 or 1000 items past the last element of a slice?

The way D's gc works makes xor pointers invalid, so even sorta safe pointers are explicitly broken

Probably store whatever in an int

The documentation states that going one past the last element

If you read that d makes string litterals c strings, that only string litterals. Most overflows are a crash and idk how your not running into that? Yourve ready enough go start syntax testing.
              • ... 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