Closed michael-schwarz closed 11 months ago
Some tools (e.g. Goblint) take care to not access the first component of
CReal
as OCamlfloat
s can not accurately represent such large constants.
That's not true since the addition of float domains though: https://github.com/goblint/analyzer/blob/15e6c3d636bde630a5df20d31af2c812355b68a2/src/analyses/base.ml#L764
That's not true since the addition of float domains though
Ah, that is an oversight on the Goblint side then, we should not encounter CReal
that do not have a string representation there. In a separate PR to bump Goblint's dependency, I will switch that code path in Goblint to create a top
value of the appropriate type to be on the safe side.
If it should never happen, then maybe it can even be assert false
to indicate intended unreachability? If that ever breaks, then CIL creates CReal
s without string representations when it shouldn't.
If it should never happen, then maybe it can even be
assert false
to indicate intended unreachability?
It is not impossible on the CIL side, as one could easily define some such value using the API, but parsing programs should not yield such values.
Asserting false
would break existing usages of CIL, if we were open to that, one could just remove the float
part of CReal
entirely, but I want to take a more gentle approach here to not unnecessarily break compatibility even more.
We could add an assert false on the Goblint side of things, instead of going to top?
We could add an assert false on the Goblint side of things, instead of going to top?
Yes, that's what I meant. Sorry for not being clear about it.
Some tools (e.g. Goblint) take care to not access the first component of
CReal
as OCamlfloat
s can not accurately represent such large constants.There should be an option to silence these warnings for tools that are aware of this pitfall to avoid polluting logs.