[cfe-dev] Possible trivial correction to test/Analysis/malloc-annotations.c

bruce.r.stephens at gmail.com bruce.r.stephens at gmail.com
Thu Apr 18 13:34:43 PDT 2013


Anna Zaks <ganna-2kanFRK1NckAvxtiuMwx3w at public.gmane.org> writes:

> Note, that the checker that uses the annotation (MallocOptimistic) is
> in alpha state and probably needs a major redesign and
> productization. The functionality that is there now has not been
> tested much. Currently, that checker assumes that every function which
> might free memory will be annotated. This applies to functions that
> free memory indirectly, by calling another function. This greatly
> limits applicability of the checker.
>
> We are thinking of augmenting the MallocPessimistic, which assumes
> that any unknown function can free memory, with annotations on
> functions which the user has more info about, instead of reviving the
> MallocOptimistic checker.

Agreed, yes. The default malloc checker (MallocPessimistic, IIUC) works
well. Not perfect, of course, but very useful.

By the looks of it the annotated malloc checker would require
unrealistic amounts of annotation to bring the false positives down
enough for it to be useful at least in the codebase I'm working
on. Starting from something similar to MallocPessimistic ought to
produce something useful, much as I like (in principle) the idea of
annotating functions with ownership information.

[...]




More information about the cfe-dev mailing list