<html>#2403: compile failure with gfortran 10 when using CCTK_PointerTo
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>open</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>blocker</td></tr>
<tr><td style='text-align:right'>Component:</td><td></td></tr>
</table>

<p>Comment (by Roland Haas):</p>
<p>Still not good enough. Using <code>TYPE(*)</code> makes the function independent of the type, but not the rank of the argument. Unfortuhantely using using <code>TYPE(*), DIMENSION(..)</code> for assumed rank changes how arguments are passed and <code>CCTK_PointerTo(a)</code> is no longer passed the address of <code>a</code> as its first argument. So far the best I could come up with is to overload (assuming that all compilers that check for the types are at least F90 compilers) <code>CCTK_PointerTo</code> on the Fortran side for up to 7 dimensions (that being the max allowed until Fortran 2008):</p>
<div class="codehilite"><pre><span></span>  interface CCTK_PointerTo
    CCTK_POINTER function CCTK_PointerTo0(a)
      type(*) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo1(a)
      type(*),dimension(:) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo2(a)
      type(*),dimension(:,:) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo3(a)
      type(*),dimension(:,:,:) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo4(a)
      type(*),dimension(:,:,:,:) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo5(a)
      type(*),dimension(:,:,:,:,:) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo6(a)
      type(*),dimension(:,:,:,:,:,:) :: a
    end function
    CCTK_POINTER function CCTK_PointerTo7(a)
      type(*),dimension(:,:,:,:,:,:,:) :: a
    end function
  end interface
</pre></div>


<p>then on the C side of things provide 8 identical <code>CCTK_PointerTo</code> functions.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2403/compile-failure-with-gfortran-10-when'>https://bitbucket.org/einsteintoolkit/tickets/issues/2403/compile-failure-with-gfortran-10-when</a></p>
</html>