#1575: Declare cctkGH as "const cGH*" -------------------------+-------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: new Priority: major | Milestone: Component: Cactus | Version: development version Keywords: | -------------------------+-------------------------------------------------- cctkGH is declared as "const cGH*" in several places, but DECLARE_CCTK_ARGUMENTS still declares it only as "cGH*". This should be changed.
I checked, and some thorns need updating to deal with this. I propose to make this change after the release.
#1575: Declare cctkGH as "const cGH*" --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: review Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+------------------------------------------------- Changes (by eschnett):
* status: new => review
#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 rhaas):
I have no objections to such a change. There is nothing to review in the ticket though.
#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.)
#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 hinder):
Should this be closed as "wontfix"? In theory, making things safer for application thorns would be worth adding a bit of complexity to infrastructure thorns, but if it's too much work, then we can just leave it as is.
#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):
The long-term fix would be to encapsulate the cctkGH fields properly so that they don't have to be set explicitly. I'm leaning towards leaving this as "won't fix".
#1575: Declare cctkGH as "const cGH*" --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: closed Priority: major | Milestone: Component: Cactus | Version: development version Resolution: wontfix | Keywords: --------------------------+------------------------------------------------- Changes (by knarf):
* status: review => closed * resolution: => wontfix
trac@lists.einsteintoolkit.org