cctk.h includes cctk_Arguments.h

Issue #2384 resolved
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) {

compiles. This is somewhat surprising as the thorn writing docs 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/ 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

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 (9)

  1. Roland Haas reporter

    I am not very familiar with the development process in canuda rather than commit myself I will try and let the authors merge in in a way they are comfortable with (later this month) and apply the flesh change afterwards (things fail to compile if I first apply the flesh change).

    Unless objected I will apply to proca after January 31st.

  2. Roland Haas reporter

    Accidentally applied today (misread the date). Applied as git hash a62cc85 "Proca: include cctk_Arguments when using DECLARE_CCTK_ARGUMENTS _" of Proca

  3. Log in to comment