[splint-discuss] [Beginner] Glib data structures not detected as freed
Jeff Johnson
n3npq at mac.com
Wed Jan 14 05:15:14 PST 2009
On Jan 14, 2009, at 4:25 AM, Stephane Bortzmeyer wrote:
> On Tue, Jan 13, 2009 at 05:22:53PM -0500,
> Jeff Johnson <n3npq at mac.com> wrote
> a message of 135 lines which said:
>
>> Whether you consider adding C comments (aka splint annotations) to
>> glib prototypes as "modifying source" is all in the eye of the
>> beholder.
>
> Well, I tried the following in my source code:
>
> /* Repeat the prototype with annotations */
> GList *g_list_delete_link(GList * list,
> GList * link_)
> /* @releases list@ */ ;
>
> And I get the same warning:
>
> test-glib-splint.c:32:5: Fresh storage list (type GList *) not
> released before
> assignment: list = g_list_delete_link(list, g_list_last(list))
> test-glib-splint.c:29:5: Fresh storage list created
Without context its a bit hard to tell.
Try this
/* Repeat the prototype with annotations */
GList *g_list_delete_link(/*@only@*/ GList * list,
GList * link_)
/*@modifies list @*/ ;
The @only@ annotation should mark "list" as being released.
Note that link list memory annotations are often
hard to get right in my experience using splint as well.
hth
73 de Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4664 bytes
Desc: not available
Url : http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20090114/b31a660b/attachment.bin
More information about the splint-discuss
mailing list