#1975: Cactus: mark routines used by DECLARE_CCTK_ARGUMENTS as pure --------------------------+------------------------------------------------- Reporter: rhaas | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+------------------------------------------------- Changes (by rhaas):
* status: new => review
Comment:
As far as I know, dependence on global variables is allowed for pure functions (from the linked gcc docs): {{{ pure Many functions have no effects except the return value and their return value depends only on the parameters and/or global variables. }}} and eg strlen is given as an example.
They are not "const" since their result depends on more than just the *values* of their arguments (they inspect the content of the pointers and the gcc state that for const "Basically this is just slightly more strict class than the pure attribute below, since function is not allowed to read global memory.").
I think one has to be very careful with what is const and what is pure. Code generation errors may be a different matter.