Closed codyroux closed 5 years ago
The output of clightgen
is fine and works for me. You are referring to the debugging output of Clight
which uses a C like syntax.
Correct, I am referring to the contents of foo.light.c
, which should probably be valid C code?
CompCert's -dclight
output is a best effort: it tries to look like valid C code, but it's not always possible, because a few constructs of Clight are actually more general than the corresponding C constructs. The main purpose of the -d
outputs is to understand what the compiler is doing, and in the case of clightgen
what Clight code was generated in the output .v
file.
This being said, there was a mistake in the way clightgen -dclight
prints function parameters. This should now be fixed.
Fantastic! I see why having C light and C differ would be useful, and I greatly appreciate the bug fix, unfortunately embedded code tends to make intensive use of bitfields and it's nice to have the pretty-printed syntax for sanity checking.
The following code:
After running
clightgen -v -fbitfields -dclight foo.c
, gives:Which has some undeclared variables
$56
and$57
(presumably refering to theset_baz
function arguments).The version of clightgen is 3.5, built off of current
master
.