Re: g_object_ref() now propagates types





On Fri, Dec 8, 2017 at 6:26 AM, Philip Withnall <philip tecnocode co uk> wrote:
Hi all,

We just landed a patch in GLib which propagates the type from the
argument of g_object_ref() to its return type:

https://git.gnome.org/browse/glib/commit/?id=3fae39a5d
https://bugzilla.gnome.org/show_bug.cgi?id=790697

The idea here is that it will catch invalid implicit casts which the
compiler otherwise wouldn’t have noticed because g_object_ref()
previously operated entirely on gpointers. This will eliminate a whole
class of bugs: bugs which are unlikely to exist, but are a complete
pain to track down if they do.

​Great work. Another 3 or 4 or 200 of these and we'll almost have a C++ compiler!

tongue firmly and warmly in cheek :))) ​



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