Re: weak_pointer_location parameter to g_object_add_weak_pointer



On 2/6/02 12:21 PM, "Owen Taylor" <otaylor redhat com> wrote:

> - Silently accepting a 'GObject *' will lead to people making the
>   mistake of passing in the object rather than the location of the
>   object, either inadvertently, or due to misunderstandings of how
>   pointers work in C.

But if every caller has to put in a cast to (gpointer *), we still silently
accept a GObject * in otherwise-correct code. I don't think it's any less
likely to lead to errors if you always have a cast, rather than never having
a cast. In either case, you can pass a pointer of the wrong type in code
that's otherwise correct.

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]