<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>new</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>Compiling with gfortran currently fails with (among others):</p>
<div class="codehilite"><pre><span></span>COMPILING CactusExamples/DemoInterp/src/Interp1D.F
/Users/jenkins/Cactus/configs/sim/build/DemoInterp/Interp1D.f:191:37:

  183 |       interp_coords(1) = CCTK_PointerTo(xcoord)
      |                                        2
......
  191 |       out_arrays(2) = CCTK_PointerTo(compinterp1)
      |                                     1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/REAL(8)).
</pre></div>


<p>and there seems to be little we can do about this since <code>CCTK_PointerTo</code> does have to accept all kinds of arguments. The same issue should also affect things like eg <code>MPI_Send</code> which takes pointers to arbitrary arrays.</p>
<p>This can be turned into a warning by adding <code>-fallow-argument-mismatch</code> to <code>F90FLAGS</code> (see <a data-is-external-link="true" href="https://github.com/Unidata/netcdf-fortran/issues/212" rel="nofollow">https://github.com/Unidata/netcdf-fortran/issues/212</a>), though the option only exists for gfortran 10 so cannot be added to the default set of flags.</p>
<p>If the issue indeed also affects MPI I would expect that the next version of gfortran no longer produces the warning.</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>