|
|
|
|
|
by lrossi
1969 days ago
|
|
I am aware of that environment variable. The problem is that I think almost nobody is using it, so it could come with a risk of introducing more bugs. By the way, the example shown in the documentation page that you link to seems ridiculous: void *slist = g_slist_alloc (); /* void* gives up type-safety */
g_list_free (slist); /* corruption: sizeof (GSList) != sizeof (GList) */
This bug should actually be caught during compilation if we store the list in a GSList* typed variable instead of void*. You’d think: who does that?Except that this is what you actually end up doing when using any kind of nested glib containers. Elements are always void*, so you have to cast them correctly. So for non-trivial applications, it’s very easy to make mistakes, since you lose the type checking support of the compiler. C is already a tricky language. Removing the type checker makes it even worse. |
|
I looked to port Gtk to MCU, and then gave up. Too much C trickery, and hard to replace, heavy dependencirs.
For somebody who knew Qt, and Gtk since 2003, it looks like a miracle now how Qt got smaller, and faster than Gtk, and can even run on an MCU, and quite well!
Very big contribution to that was Qt's team willingness to undo the wheel reinvention, and willingness to throw out their hacky attempts to replicate new c++, and standard lib functionality.
The Glib+Gtk world, unlike Qt, still lives in ANSI C, and C99 era, and refuses to concede on reinventing functionality of modern standard libraries, language features, and compilers.