# Pointer mapping between real and complex arrays

**URL:** <https://fortran-lang.discourse.group/t/pointer-mapping-between-real-and-complex-arrays/8851>\
**Category:** Help\
**Created:** [November 17, 2024, 10:15am UTC](https://fortran-lang.discourse.group/t/pointer-mapping-between-real-and-complex-arrays/8851 "2024-11-17T10:15:07Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [November 18, 2024, 3:28pm UTC](https://fortran-lang.discourse.group/t/pointer-mapping-between-real-and-complex-arrays/8851/15 "2024-11-18T15:28:39Z")

</div>

> [@septc](#):
>
> In the above code, does `rr.span = 16` mean that Gfortran represents the array pointer for the real parts as something like a stride-1 array with 8-byte padding between elements? If so, `is_contiguous()` should be modified as `stride == 1 && span == elem_len` or similar…?

The descriptor contents can be found here: [gcc/libgfortran/libgfortran.h at 70999668a1305571d3b5fc57168fcb060a976418 · gcc-mirror/gcc · GitHub](https://github.com/gcc-mirror/gcc/blob/70999668a1305571d3b5fc57168fcb060a976418/libgfortran/libgfortran.h#L387)

Looking at the commit message that introduced `.span` it is a property set only for pointer arrays. Skimming through the source, it looks like the array assignment `a => c` gets handled by `gfc_conv_expr_descriptor` which internally calls `gfc_get_array_span`: [gcc/gcc/fortran/trans-array.cc at 70999668a1305571d3b5fc57168fcb060a976418 · gcc-mirror/gcc · GitHub](https://github.com/gcc-mirror/gcc/blob/70999668a1305571d3b5fc57168fcb060a976418/gcc/fortran/trans-array.cc#L8445C1-L8448C40)

---

_[View the full topic](https://fortran-lang.discourse.group/t/pointer-mapping-between-real-and-complex-arrays/8851)._
