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 342304 - libgnome 'make' fails with 'gnome-gconf.c:33: error: array type has incomplete element type'
libgnome 'make' fails with 'gnome-gconf.c:33: error: array type has incomplet...
Status: RESOLVED FIXED
Product: libgnome
Classification: Deprecated
Component: general
2.14.x
Other All
: Normal normal
: ---
Assigned To: libgnome maintainer
libgnome maintainer
Depends on:
Blocks:
 
 
Reported: 2006-05-19 01:18 UTC by Sergei Steshenko
Modified: 2006-05-23 15:49 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
proposed patch (801 bytes, patch)
2006-05-19 13:09 UTC, Christian Persch
none Details | Review
modified gnome-gconf.c which compiles OK (5.04 KB, text/plain)
2006-05-19 14:50 UTC, Sergei Steshenko
  Details

Description Sergei Steshenko 2006-05-19 01:18:09 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.
Comment 1 Christian Persch 2006-05-19 13:08:41 UTC
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?
Comment 2 Christian Persch 2006-05-19 13:09:39 UTC
Created attachment 65832 [details] [review]
proposed patch
Comment 3 Sergei Steshenko 2006-05-19 14:47:49 UTC
(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;
.

Comment 4 Sergei Steshenko 2006-05-19 14:50:41 UTC
Created attachment 65841 [details]
modified gnome-gconf.c which compiles OK

This is full gnome-gconf.c which contain the above described changes.
Comment 5 Sergei Steshenko 2006-05-19 20:03:36 UTC
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.
Comment 6 Kjartan Maraas 2006-05-22 13:58:57 UTC
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?
Comment 7 Christian Persch 2006-05-22 19:43:05 UTC
I think it's safe to apply the patch, since the option struct is empty.
Comment 8 Kjartan Maraas 2006-05-23 15:49:08 UTC
Commited.