<html>#2358: rdwr.pl does not correct declare READS (only) variables are const
<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>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>
<p>Variables that are <code>READS</code> only are supposed to be declared <code>const</code>, however this seems to not happen and a schedule block</p>
<div class="codehilite language-perl"><pre><span></span><span class="n">SCHEDULE</span> <span class="n">TestReadWrite_TestC_C</span> <span class="n">AT</span> <span class="n">initial</span> <span class="n">AFTER</span> <span class="n">TestReadWrite_TestC_B</span>
<span class="p">{</span>
<span class="n">WrITES:</span> <span class="nn">TestReadWrite::</span><span class="n">varpastlevelc</span>
<span class="n">WRITES:</span> <span class="n">grouppastlevelc</span>
<span class="n">ReADs:</span> <span class="n">Var1</span>
<span class="n">READS:</span> <span class="nn">TestReadWriteImp::</span><span class="n">Var1_p</span>
<span class="n">READs:</span> <span class="n">var2</span>
<span class="n">READs:</span> <span class="nn">TestReadWrite::</span><span class="n">groupvar1</span>
<span class="c1"># in XXX this does not accept bare "groupvar2" and CST's hint read:</span>
<span class="c1"># HINT: Did you mean testreadwrite::testgroup? Did you mean testreadwriteimp::testgroup?</span>
<span class="n">READS:</span> <span class="nn">testreadwriteimp::</span><span class="n">groupvar2</span>
<span class="n">READs:</span> <span class="nn">testreadwriteimp::</span><span class="n">testgroup_p_p</span>
<span class="n">WrITES:</span> <span class="n">VarCurrentLevelC</span><span class="p">,</span> <span class="n">GroupCurrentLevelC</span>
<span class="n">LANG:</span> <span class="n">C</span>
<span class="p">}</span> <span class="s">"Record results in grid scalars"</span>
</pre></div>
<p>lets this code compile</p>
<div class="codehilite"><pre><span></span>extern "C"
void TestReadWrite_TestC_C(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS_TestReadWrite_TestC_C;
*VarCurrentLevelC = Var1[0] == 42. && Var2[0] == 45.;
*GroupCurrentLevelC = groupVar1[0] == 43 && groupVar2[0] == 44;
*VarPastLevelC = Var1_p[0
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2358/rdwrpl-does-not-correct-declare-reads-only'>https://bitbucket.org/einsteintoolkit/tickets/issues/2358/rdwrpl-does-not-correct-declare-reads-only</a></p>
</html>