After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 344788 - cvs build failure -- missing initializer when declaring and defining struct instance
cvs build failure -- missing initializer when declaring and defining struct i...
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: build
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2006-06-13 17:33 UTC by Elijah Newren
Modified: 2006-06-18 02:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that removes initialization fields altogether (4.83 KB, patch)
2006-06-14 00:49 UTC, Jonathon Jongsma
none Details | Review

Description Elijah Newren 2006-06-13 17:33:41 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.
Comment 1 Jonathon Jongsma 2006-06-14 00:49:42 UTC
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.
Comment 2 Murray Cumming 2006-06-16 21:29:12 UTC
I'd rather really initialize it. I'm surprised that this only showed up now.
Comment 3 Jonathon Jongsma 2006-06-17 19:21:03 UTC
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.
Comment 4 Elijah Newren 2006-06-17 19:31:48 UTC
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
Comment 5 Jonathon Jongsma 2006-06-18 02:26:09 UTC
OK, I've committed with an initializer of 0 for the last field.  Thanks.