[splint-discuss] Tell me more about @only@
AlannY
m at alanny.ru
Thu Jan 14 03:35:50 PST 2010
On Wed, Jan 13, 2010 at 02:23:33PM -0500, Jeff Johnson wrote:
>
> /*@only@*/ is the strongest annotation.
>
> Slightly weaker /*@onwned@*/ and /*@dependent@*/ are
> easier when link lists are involved. The difference
> (at least how I annotate) is that /*@owned@*/ goes
> on the link list anchor, where the free's are typically
> down, while /*@dependent@*/ goes on the chaining
> variables.
>
> There's also /*@shared@*/ which asserts nothing about
> malloc/free for pointers.
>
> IIRC, the defaults are /*@only@*/ for pointers, so one has to
> weaken the default assumptions.
>
> Note also that /*@null@*/ is quite painful sometimes. Replace
> with /*@relnull@*/ if the pain gets too great.
>
> Again, these are just hints from how I use splint annotations. YMMV and likely
> will. One has to focus quite carefully to understand what splint
> is warning about.
>
> hint: Understanding comes with some rather deep pain sometimes. True
> for splint and all lin-like annotations. So disable until you are
> ready to sort out the issue. If now, well, enjoy! ;-)
>
> Try /*@dependent@*/ or possibly /*@shared@*/ instead of /*@only@*/.
>
> hth
>
> 73 de Jeff
Thanks, it helps. I'll continue research on @dependent at ...
--
)\._.,--....,'``.
/, _.. \ _\ (`._ ,.
`._.-(,_..'--(,_..'`-.;.'
More information about the splint-discuss
mailing list