GNOME Bugzilla – Bug 344788
cvs build failure -- missing initializer when declaring and defining struct instance
Last modified: 2006-06-18 02:26:09 UTC
I'm getting: accelmap.cc: In function `bool Gtk::AccelMap::lookup_entry(const Glib::ustring&, Gtk::AccelKey&)': accelmap.cc:69: warning: missing initializer for member `_GtkAccelKey::accel_flags' make[5]: *** [accelmap.lo] Error 1 make[5]: Leaving directory `/export/home/b/newrenTemp/gnome/gtkmm/gtk/gtkmm' make[4]: *** [all-recursive] Error 1 make[4]: Leaving directory `/export/home/b/newrenTemp/gnome/gtkmm/gtk/gtkmm' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/export/home/b/newrenTemp/gnome/gtkmm/gtk' make[2]: *** [all] Error 2 make[2]: Leaving directory `/export/home/b/newrenTemp/gnome/gtkmm/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/export/home/b/newrenTemp/gnome/gtkmm' make: *** [all] Error 2 Fix I used (didn't check if this is actually the wanted flag values or not) was to just add another 0 at the end of the initializer list.
Created attachment 67308 [details] [review] patch that removes initialization fields altogether Well, the gkey parameter here will simply be filled by the gtk_accel_map_lookup_entry call, so I'm inclined to just remove the initialization values altogether (since they're clearly just fillers anyway). Anybody opposed to this solution? patch attached.
I'd rather really initialize it. I'm surprised that this only showed up now.
well, I don't believe it shows up unless you add -Werror and/or -Wextra, right Elijah? If you want to initialize it, then passing 0 would be the proper fix, I suppose. I can commit that change.
Don't look at me, it wasn't *me* who added -Werror. ;-) autogen.sh has this in it (which I'm guessing was to prevent warning errors from 2.x users, but maybe really was meant to prevent you from getting errors from gcc-4.x users too?) : case "$*" in *--enable-warnings*|*--disable-warnings*) ;; *) # enable -Werror by default when building with gcc3 ${CXX:-"g++"} --version 2>/dev/null | grep '(GCC) 3\.[0-9]\+\.[0-9]' >/d ev/null 2>&1 \ && enable_warnings='--enable-warnings=hardcore' ;; esac
OK, I've committed with an initializer of 0 for the last field. Thanks.