Proposal to change casting for g_object_ref()



Hi all,

(Please keep me explicitly CCed, since I’m not subscribed to the list.)

Christian is proposing changing g_object_ref() to be a wrapper macro
around the actual function, which propagates type information using
GCC’s typeof() extension.

https://bugzilla.gnome.org/show_bug.cgi?id=790697

It eliminates a class of bugs which are rarely seen, but a pain to
detect manually. (Passing one type into g_object_ref() and then
assigning the result to a completely unrelated type: essentially an
invalid cast which is indirected through g_object_ref() so the compiler
doesn’t detect it.)

This turns out to work quite well on C, but we’re unsure how it will
affect C++ and gtkmm. If it’s going to cause problems for gtkmm, please
let us know (on the bug report) in the next couple of weeks, otherwise
it’ll land.

Thanks!
Philip

Attachment: signature.asc
Description: This is a digitally signed message part



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