GNOME Bugzilla – Bug 342304
libgnome 'make' fails with 'gnome-gconf.c:33: error: array type has incomplete element type'
Last modified: 2006-05-23 15:49:08 UTC
Steps to reproduce: 1. run the standard build process with gcc v4.0.1 2. 3. Stack trace: Other information: According to 'google', the code using a construct like the failing extern struct poptOption gconf_options[]; one is erroneous. The file is: libgnome-2.8.1/libgnome/gnome-gconf.c . See, for example: http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html -> http://gcc.gnu.org/ml/gcc/2005-02/msg00054.html -> http://gcc.gnu.org/ml/gcc/2005-02/msg00061.html . Replacing the declaration with extern struct poptOption *gconf_options; makes problem move further down the code: " gnome-gconf.c: In function '_gnome_gconf_module_info_get': gnome-gconf.c:171: error: initializer element is not constant gnome-gconf.c:171: error: (near initialization for 'module_info.options') ", i.e. here: 160 const GnomeModuleInfo * 161 _gnome_gconf_module_info_get (void) 162 { 163 static GnomeModuleInfo module_info = { 164 "gnome-gconf", 165 gconf_version, 166 NULL /* description */, 167 NULL /* requirements */, 168 NULL /* instance init */, 169 NULL /* pre_args_parse */, 170 NULL /* post_args_parse */, 171 gconf_options, 172 NULL /* init_pass */, 173 NULL /* class_init */, 174 NULL, NULL /* expansions */ 175 }; . I'm out of simple options.
This builds fine here with gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5)... I'd have thought that bug 302071 fixed this problem... Since gconf/gconf/gconf.c defines this struct to be: struct poptOption gconf_options[] = { {NULL} }; I think we can just do away with this cruft. Can you try the attached patch?
Created attachment 65832 [details] [review] proposed patch
(In reply to comment #2) > Created an attachment (id=65832) [edit] > proposed patch > Could you please tell me the exact command line to use or attach the full file ? Meanwhile I found this solution: " [109] 17:43 sergei@comp.home.net:/> diff /mnt/removable/sergei/build_work/build/libgnome-2.8.1/libgnome/gnome-gconf.c /mnt/removable/sergei/build_work/build/libgnome-2.8.1/libgnome/gnome-gconf.c.original 33c33 < extern struct poptOption *gconf_options; --- > extern struct poptOption gconf_options[]; 163,175c163,175 < static GnomeModuleInfo module_info = { < "gnome-gconf", < gconf_version, < NULL /* description */, < NULL /* requirements */, < NULL /* instance init */, < NULL /* pre_args_parse */, < NULL /* post_args_parse */, < NULL /* options */, < NULL /* init_pass */, < NULL /* class_init */, < NULL, NULL /* expansions */ < }; --- > static GnomeModuleInfo module_info = { > "gnome-gconf", > gconf_version, > NULL /* description */, > NULL /* requirements */, > NULL /* instance init */, > NULL /* pre_args_parse */, > NULL /* post_args_parse */, > gconf_options, > NULL /* init_pass */, > NULL /* class_init */, > NULL, NULL /* expansions */ > }; 177,178c177 < module_info.description = _("GNOME GConf Support"); < module_info.options = gconf_options; --- > module_info.description = _("GNOME GConf Support"); 180c179 < return &module_info; --- > return &module_info; [110] 17:43 sergei@comp.home.net:/> ", that is, 1) extern struct poptOption gconf_options[]; is replaced with extern struct poptOption *gconf_options ; 2) The initialization part: " const GnomeModuleInfo * _gnome_gconf_module_info_get (void) { static GnomeModuleInfo module_info = { "gnome-gconf", gconf_version, NULL /* description */, NULL /* requirements */, NULL /* instance init */, NULL /* pre_args_parse */, NULL /* post_args_parse */, gconf_options, NULL /* init_pass */, NULL /* class_init */, NULL, NULL /* expansions */ }; module_info.description = _("GNOME GConf Support"); return &module_info; } " is modified to be: const GnomeModuleInfo * _gnome_gconf_module_info_get (void) { static GnomeModuleInfo module_info = { "gnome-gconf", gconf_version, NULL /* description */, NULL /* requirements */, NULL /* instance init */, NULL /* pre_args_parse */, NULL /* post_args_parse */, NULL /* options */, NULL /* init_pass */, NULL /* class_init */, NULL, NULL /* expansions */ }; module_info.description = _("GNOME GConf Support"); module_info.options = gconf_options; return &module_info; } - basically, a line has been changed: gconf_options, -> NULL /* options */, and another added: module_info.options = gconf_options; .
Created attachment 65841 [details] modified gnome-gconf.c which compiles OK This is full gnome-gconf.c which contain the above described changes.
OOPS, the problem happened to be in version 2.8.1 of GNOME - had a type with versions of this particular target. With 2.14.1 version everything works: " 21 make[3]: Entering directory `/mnt/removable/sergei/build_work/build/libgnome-2.14.1/libgnome' 22 if /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I./.. -Wall -Wmissing-prototypes 22 -DORBIT2=1 -pthread -I/mnt/removable/sergei/build_work/install/GConf-2.14.0/include/gconf/2 -I/mnt/removab 22 le/sergei/build_work/install/ORBit2-2.14.0/include/orbit-2.0 -I/mnt/removable/sergei/build_work/install/audi 22 ofile-0.2.6/include -I/mnt/removable/sergei/build_work/install/esound-0.2.36/include -I/mnt/removable/sergei 22 /build_work/install/glib-2.10.1/include/glib-2.0 -I/mnt/removable/sergei/build_work/install/glib-2.10.1/lib/ 22 glib-2.0/include -I/mnt/removable/sergei/build_work/install/gnome-vfs-2.8.4/include/gnome-vfs-2.0 -I/mnt/rem 22 ovable/sergei/build_work/install/gnome-vfs-2.8.4/lib/gnome-vfs-2.0/include -I/mnt/removable/sergei/build_wor 22 k/install/libbonobo-2.14.0/include/bonobo-activation-2.0 -I/mnt/removable/sergei/build_work/install/libbonob 22 o-2.14.0/include/libbonobo-2.0 -DG_DISABLE_DEPRECATED -DLIBGNOME_PREFIX=\""/mnt/removable/sergei/build_wor 22 k/install/libgnome-2.14.1"\" -DLIBGNOME_LIBDIR=\""/mnt/removable/sergei/build_work/install/libgnome-2.14.1/l 22 ib"\" -DLIBGNOME_DATADIR=\""/mnt/removable/sergei/build_work/install/libgnome-2.14.1/share"\" -DLIBGNOME_LOC 22 ALSTATEDIR=\""/mnt/removable/sergei/build_work/install/libgnome-2.14.1/var"\" -DLIBGNOME_SYSCONFDIR=\""/mnt/ 22 removable/sergei/build_work/install/libgnome-2.14.1/etc"\" -DVERSION=\""2.14.1"\" -DGNOMEVFSVERSION=\"2.8.4\ 22 " -DG_LOG_DOMAIN=\"Gnome\" -g -O2 -MT libgnometypebuiltins.lo -MD -MP -MF ".deps/libgnometypebuiltins.Tpo ". I apologize for the confusion - I'm developing a script which builds a lot of things (GNOME, gtk2-perl, wxwidgets, wxperl), so I misspecified the versions.
Ok, closing this as fixed in a later release then. Christian, should we still apply your patch to get rid of the cruft, or can we leave it in?
I think it's safe to apply the patch, since the option struct is empty.
Commited.