[Developers] parameter data type check?
Erik Schnetter
schnetter at cct.lsu.edu
Tue Nov 7 14:04:47 CST 2006
On Nov 7, 2006, at 13:21:06, Bela Szilagyi wrote:
> I just caught myself having had in one of my param.ccl files the
> declaration
>
> CCCTK_INT index_of_AH[3] "....."
> {
> 0 :: "...."
> # .....
> } 0
>
> where the three "C"-s from CCCTK_INT are indeed there in the parameter
> declaration file.
>
> Compilation seems to have gone through with no trouble. The
> question is --
> what kind of variable is this "index_of_AH" in my C routine?
>
> More generically -- is there any check/enforcement that the user
> declarations
> are consistent with the set of defined cactus data types?
Don't worry, there are lots of checks there; all automatically
produced C code is produced via rules that ensure that only legal C
code is created. Having said that, there can of course be errors or
omissions in Cactus, but there are no big holes.
You have found an interesting bug. The parser for parameter files is
supposed to accept two syntaxes, "INT" and "CCTK_INT", for the same
data type. However, the parser accidentally also allows arbitrary
characters on the same line in front of the data type. That is, the
first "C" is ignored as garbage, the remainder is then parsed as
expected.
The source of the bug is a missing "^" (caret) character in line 151
of the file lib/sbin/parameter_parser.pl, which forbids leading
additional characters.
-erik
--
Erik Schnetter <schnetter at cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://www.cactuscode.org/pipermail/developers/attachments/20061107/e6847b2c/attachment.bin
More information about the Developers
mailing list