[Vala] Should be warning(maybe error) when method with [ReturnsModifiedPointer] is called from unowned variable
- From: Tal Hadad <tal_hd hotmail com>
- To: Vala Mail List <vala-list gnome org>
- Subject: [Vala] Should be warning(maybe error) when method with [ReturnsModifiedPointer] is called from unowned variable
- Date: Sun, 4 Nov 2012 21:52:25 +0200
There should be warning(maybe error) when method with
[ReturnsModifiedPointer] is called from unowned variable.
Take a look on GLib.SList. The beginner programer(me too) can be
assign an unowned variable to the list, and remove items, but he
don't know it shell update the owned pointer.
Example:
GLib.SList list = given_list;
list.remove(data);
Naive programers can be fooled(like me) that this code are valid,
since Vala print no errors neither warning.
I think we all agree it's NOT ok, but do you see this as error or warning?
Yours
Tal
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]