Parameter file parser generates illegal (?) C code

Issue #2752 new
Erik Schnetter created an issue

I see this warnings when building the autogenerated Cactus bindings:

/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c: In function 'CCTKi_BindingsCreateTwoPunctures_BBHSFParameters':
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c:193:116: warning: unknown escape sequence: '\p'
  193 |                         "Exponent delta for conformal decomposition of the scalar field \phi = \psi^delta \bar\phi",
      |                                                                                                                    ^
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c:193:116: warning: unknown escape sequence: '\p'
/Users/eschnett/Cactus/configs/sim-debug/bindings/Parameters/TwoPunctures_BBHSF_Parameters.c:193:116: warning: unknown escape sequence: '\p'

It seems that a parameter description in a ccl file contains latex code, and the parameter file parse does not properly escape backslashes when generating C strings for them.

Comments (2)

  1. Roland Haas

    Yup, most likely this is a “\phi” (ie LaTeX syntax) in one of the parameter descriptions of TwoPunctures_BBHSF. Those get copied to C strings and will then trigger this.

    The simplest solution is to not use LaTeX code in Cactus description strings (or double up on the backslash). A better solution (in Cactus) may to sanitize strings passed in by users, but is only doable if there are not yet thorns that that double up the backslash already (right now grep -rF '\\' arrangements///*.ccl returns none).

    Cheng-Hsin and Giuseppe are maintainers, but Bitbucket will not let me enter Cheng-Hsin into the assignee field (even though he is a teammate) and Giuseppe does not seem to be a team member.

  2. Log in to comment