cctk.h includes cctk_Arguments.h

Create issue
Issue #2384 new
Roland Haas created an issue

As of git hash 28a0e1d9 "This patch makes the CST stage create prototypes for all scheduled functions into a new file cctk_ScheduleFunctions.h, which is included into cctk.h." of cactus (about 9 years ago) cctk.h includes via ${thorn}_Schedule.h and the generated function prototypes for scheduled routines, the file cctk_Arguments.h. This means that a file like this:

#include <cctk.h>

void Null_Fun(CCTK_ARGUMENTS) {
  DECLARE_CCTK_ARGUMENTS;
  return;
}

compiles. This is somewhat surprising as the thorn writing docs http://einsteintoolkit.org/usersguide/UsersGuidech9.html#x13-85000C1.6.2 says that the file should be included.

For the most part code in the ET actually does so, though at least one file (MoL/src/MoLPreSync.cc) does not.

The prototypes are generated only for C routines where CCTK_ARGUMENTS always ends up being cGH *cctkGH though the route there is somewhat convoluted and involves a define (generated in GridFunStuff.pl):

push(@data, '#define CCTK_ARGUMENTS CCTK_CARGUMENTS')
push(@data, "#define CCTK_CARGUMENTS \U$thorn" . '_CARGUMENTS');
push(@returndata, "#define ${thorn}_CARGUMENTS cGH *cctkGH")

not immediately definable in cctk.h.

To avoid exposing DECLARE_CCTK_ARGUMENTS via cctk.h including ${thorn}_Schedule.h to files only including cctk.h one may want to move ${thorn}_Schedule.h instead into cctk_Arguments.h which is the file one is supposed to include when using Cactus argument lists.

Comments (0)

  1. Log in to comment