Re: GCC4 and building gnome-vfs



tor, 31,.03.2005 kl. 10.26 +0200, skrev Alexander Larsson:
> On Tue, 2005-03-29 at 14:44 +0200, Kjartan Maraas wrote:
> > Hi.
> > 
> > I'm running into problems building gnome-vfs with the new GCC in Fedora
> > Core 4 test releases. I've cooked up a patch to "fix" some of them, but
> > I need more help with the stuff in gnome-vfs-handle.c
> > 
> > Attaching a patch for the stuff I have now.
> > 
> > The error I'm seeing that I don't see how to fix immediately is this
> > one:
> > 
> > gnome-vfs-handle.c: In function '_gnome_vfs_handle_do_tell':
> > gnome-vfs-handle.c:174: warning: pointer targets in passing argument 3
> > of 'handle->uri->method->tell' differ in signedness
> 
> 
> typedef GnomeVFSResult (* GnomeVFSMethodTellFunc)
> 					(GnomeVFSMethod *method,
> 					 GnomeVFSMethodHandle *method_handle,
> 					 GnomeVFSFileOffset *offset_return);
> 
> vs:
> 
> GnomeVFSResult
> _gnome_vfs_handle_do_tell (GnomeVFSHandle *handle,
> 			  GnomeVFSFileSize *offset_return)
> 
> 
> offset_return have different types, that indeed differ by sign.
> 
> GnomeVFSFileSize is whats used in the public api which can't be changed.
> It seems right to me to.
> 
Failing to parse this. It seems right to you to what? I tried using
GnomeVFSFileSize for both, but ran into other problems with that change.

> > I see from the fedora package that someone has added some cases of
> > #undef error
> > for some similar issues with other methods, but I'm not well enough
> > versed in the preprocessing magic to know how this should be done in
> > this case. Anyone?
> 
> The #undef calls are to handle the fact that some version of glibc had
> macros named open etc. This is somewhat unfortunate, but ok with the
> spec. There are nicer fixes availible though, like calling the function
> with parenthesis around it in gnome-vfs.
> 
> > There are some sparse warning fixes and changes to make code static in
> > the patch so please comment on those too if possible.
> 
> 
> -                       split_service_instance (name, ptr_service, ptr_type, ptr_domain);
> +                       split_service_instance ((unsigned char *)name, (unsigned char *)ptr_service, (unsigned char *)ptr_type, (unsigned char *)ptr_domain);
> 
> Sooooo ugly. Isn't there a nicer way?
> 
Is this better?

                if (rr.type == ns_t_ptr) {
                        GnomeVFSDNSSDService service;
-                       char ptr_service[NS_MAXDNAME];
-                       char ptr_type[NS_MAXDNAME];
-                       char ptr_domain[NS_MAXDNAME];
+                       unsigned char ptr_service[NS_MAXDNAME];
+                       unsigned char ptr_type[NS_MAXDNAME];
+                       unsigned char ptr_domain[NS_MAXDNAME];

                        len = dn_expand (reply, reply + reply_len, p, name, size of(name));
                        if (len < 0)
                                goto error;

-                       split_service_instance (name, ptr_service, ptr_type, ptr _domain);
+                       split_service_instance ((unsigned char *)name, ptr_servi ce, ptr_type, ptr_domain);

-                       if (is_valid_dns_sd_type (ptr_type)) {
-                               service.name = g_strdup (ptr_service);
-                               service.type = g_strdup (ptr_type);
-                               service.domain = g_strdup (ptr_domain);
+                       if (is_valid_dns_sd_type ((char *)ptr_type)) {
+                               service.name = g_strdup ((char *)ptr_service);
+                               service.type = g_strdup ((char *)ptr_type);
+                               service.domain = g_strdup ((char *)ptr_domain);

                                g_array_append_val(array, service);

> diff -u -p -r1.2 xdgmimealias.c
> --- libgnomevfs/xdgmimealias.c  9 Dec 2004 15:43:48 -0000       1.2
> +++ libgnomevfs/xdgmimealias.c  29 Mar 2005 12:42:08 -0000
> 
> These need to go upstream too.
> 
>  {
> -       FileHandle *handle = (FileHandle *)method_handle;
> -       GnomeVFSResult res = GNOME_VFS_OK;;
>         SmbAuthContext actx;
>         ssize_t n = 0;
> +       FileHandle *handle = (FileHandle *)method_handle;
> +       GnomeVFSResult res = GNOME_VFS_OK;;
> 
> Does this do anything?
> 
Fix a case of mixed code and declarations which is not allowed any more
it seems.

Suspicious double semi-colon up there too I see...

Cheers
Kjartan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]