[ET Trac] [Einstein Toolkit] #223: Make declaration of CCTK_ARGUMENTS safer

Einstein Toolkit trac-noreply at einsteintoolkit.org
Thu Dec 1 16:48:26 CST 2011


#223: Make declaration of CCTK_ARGUMENTS safer
--------------------------+-------------------------------------------------
  Reporter:  eschnett     |       Owner:        
      Type:  enhancement  |      Status:  closed
  Priority:  minor        |   Milestone:        
 Component:  Cactus       |     Version:        
Resolution:  fixed        |    Keywords:        
--------------------------+-------------------------------------------------
Changes (by eschnett):

  * status:  review => closed
  * resolution:  => fixed


Comment:

 The first hunk was only present because the patches were based on an older
 version of Cactus. This hunk has been committed independently since then.

 Yes, it is still possible to modify the content of (the structure pointed
 to by) cctkGH.

 No, thorn time does not need to be modified. Since cctk_delta_space is an
 array, its corresponding local variable aliases the one in cctkGH, so it
 used to be possible to modify the cctkGH by modifying this alias, but
 since this alias is now declared const, this is not possible any more.
 However, cctk_delta_time is a scalar, and since C doesn't support
 references to scalars, the corresponding local variable is a copy, and
 therefore one cannot modify cctkGH by modifying the local variable, and
 thorn Time therefore already modifies the content of cctkGH directly.

 I have been building and running with these patches for ages, they work
 fine on all architectures, I am happy to finally commit them.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/223#comment:8>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list