[ET Trac] [Einstein Toolkit] #1575: Declare cctkGH as "const cGH*"

Einstein Toolkit trac-noreply at einsteintoolkit.org
Fri May 16 23:02:08 CDT 2014


#1575: Declare cctkGH as "const cGH*"
--------------------------+-------------------------------------------------
  Reporter:  eschnett     |       Owner:                     
      Type:  enhancement  |      Status:  review             
  Priority:  major        |   Milestone:                     
 Component:  Cactus       |     Version:  development version
Resolution:               |    Keywords:                     
--------------------------+-------------------------------------------------

Comment (by eschnett):

 This is a one-line change in GridFuncStuff.pl, line 912, adding the
 respective "const" declaration.

 Unfortunately, this change creates a lot of fallout. Many infrastructure
 thorns (driver, coordinates, I/O) change cctkGH, and would all have to
 cast away this const declaration. I'm not sure this is worth the effort.

 Also, since this casting-away is legal in this case, compilers cannot use
 this const declaration to optimize code. (I did not know this before.)

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


More information about the Trac mailing list