GNOME Bugzilla – Bug 686366
Use named union for _GtkSymbolicColor in gtk/gtksymboliccolor.c
Last modified: 2012-10-22 23:00:51 UTC
I'm using the HP ANSI C compiler on HP-UX 11 and it doesn't like unnamed unions. The only place in the whole GTK+ 3 source code that uses them is the union definition inside struct _GtkSymbolicColor (around line 60 of gtk/gtksymboliccolor.c). Unfortunately, not only do you have to name the union (e.g. sym_col) like this at the end of the struct definition: struct { gchar *theme_class; gint id; } win32; } sym_col; }; but HP's C also then wants you to use the name to access the union as well :-( Examples with the union name added: Line 100: g_free (color->sym_col.name); Line 103: gtk_symbolic_color_unref (color->sym_col.shade.color); and so on. If no-one wants to edit the 50+ lines involved, I could do it agianst gtk+ 3.6.1 and post up a context diff here as a starting poiint.
I think we usually try to be compatible with different configurations and compilers as much as possible, if it doesn't make maintaining the code much harder. What you propose here sounds quite reasonable, would you prepare a patch?
Created attachment 226750 [details] [review] Diff patch to name a union and any references to the union It's a unified diff (-u) that gives more change details than a context diff (-c), IMHO of course.
Review of attachment 226750 [details] [review]: Thanks, this looks good to me.