GNOME Bugzilla – Bug 654793
Add G_VALUE_INIT
Last modified: 2011-07-17 20:22:45 UTC
The implementation of GValue is not public or documented. When allocated on the stack, initializing a GValue is usually done as documented with: GValue value = { 0, }; There is lot code around (including WebKit) that added all the missing fields, resulting in this ugly and non-obvious: GValue value = { 0, { { 0 } } }; However, this doesn't play nice with -Wmissing-field-initializers for example. Instead, we could provide a macro doing the right job. I propose instead this: GValue value = G_VALUE_INIT; Similar to other _INIT macros in GLib.
Created attachment 192142 [details] [review] Add G_VALUE_INIT
Hmm, wrong order of paragraphs. It must be read as GValue value = { 0, }; doesn't play nice with -Wmissing-field-initializers.
*** This bug has been marked as a duplicate of bug 577231 ***