Closed mwhicks1 closed 3 years ago
This particular example now returns a single "Root cause for 3 unchecked pointers: ...". Was the work so far enough to satisfy this issue?
I think this issue can de declared resolved. As Kyle noted back in December, the -warn-root-cause
output now includes affected pointers counts, allowing the user to prioritize root causes this way. This feature was more recently integrated into the root cause regression tests in PR #578.
We have also developed a python script around the root cause analysis 3c-wrap root_cause
which can be used to view root causes ordered either by pointers affected or the weighted pointer score.
The
--warn-root-cause
and--warn-all-root-cause
flags output diagnostics that indicate the root cause for making a pointer non-checked ("WILD"). Consider this example:When we run
cconv-standalone -alltypes --warn-root-cause
on this file, we get these two diagnostics:At present, these two warnings come out in a random order. But as it turns out, the first warning is "more important" because it's an indication that
q
is made unchecked by being avoid *
but also because, as a result,x
is made so. In general, a root cause will induce potentially very many pointers, downstream, to be made unchecked, too. We should order these according to influence, with the highest influence problems coming first.Influence should not just be about how many pointers are affected, but also whether a region of code is forced to be
_Unchecked
just because of the use of a unchecked pointer influenced by a particular root cause.