# Is accessing an \`undef\` array undefined behavior?

**URL:** <https://discourse.julialang.org/t/is-accessing-an-undef-array-undefined-behavior/101899>\
**Category:** General Usage\
**Created:** [July 21, 2023, 8:43am UTC](https://discourse.julialang.org/t/is-accessing-an-undef-array-undefined-behavior/101899 "2023-07-21T08:43:17Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [July 21, 2023, 8:35pm UTC](https://discourse.julialang.org/t/is-accessing-an-undef-array-undefined-behavior/101899/22 "2023-07-21T20:35:51Z")

</div>

> [@DNF](#):
>
> Is this undefined behavior?

Yes, though probably not the kind that we’d exploit for optimization. We’d likely change the behavior of it to be defined if the compiler got to the point of being strong enough for this to be a problem (because then it could likely also optimize away the cases where it’s currently slow).

---

_[View the full topic](https://discourse.julialang.org/t/is-accessing-an-undef-array-undefined-behavior/101899)._
