Menu

#4 FTBS - libinstpatch : GIT latest r09b4081 - incompatible type

1.0
open
nobody
2017-03-22
2017-03-21
J G Miller
No

FTBS: libinstpatch : GIT latest r.09b4081

  CC       builtin_enums.lo
  CC       IpatchConverter.lo
IpatchConverter.c: In function 'ipatch_convert_object_to_type_multi_list':
IpatchConverter.c:206:11: error: incompatible type for argument 5 of 'ipatch_convert_object_to_type_multi_set_vlist'
   return (ipatch_convert_object_to_type_multi_set_vlist (object, type, err, NULL, NULL));
           ^
In file included from IpatchConverter.c:32:0:
IpatchConverter.h:228:8: note: expected 'va_list' but argument is of type 'void *'
 GList *ipatch_convert_object_to_type_multi_set_vlist (GObject *object, GType type, GError **err,
        ^
IpatchConverter.c:207:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:830: recipe for target 'IpatchConverter.lo' failed
make[3]: *** [IpatchConverter.lo] Error 1
make[3]: Leaving directory '/srv/repository/git/swami/libinstpatch/libinstpatch'

Debian GNU/Linux 8 (jessie)

gcc version 4.9.2 (Debian 4.9.2-10)

gobject-introspection 1.42.0-2.2

CONFIGURE_OPTIONS="--enable-gtk-doc"

ipatch_convert_object_to_type_multu_set_vlist is declared in IpatchConverter.h as

GList *ipatch_convert_object_to_type_multi_set_vlist (
              GObject    *object,
              GType      type,
              GError     **err,
              const char *first_property_name,
              va_list    args);

so the compiler is correct to complain that NULL (void pointer) is not of type va_list.

Discussion

  • J G Miller

    J G Miller - 2017-03-21

    The solution to this issue of needing a "NULL" equivalent for a va_list parameter as used by the Aros project (whatever that is) is to first define an empty va_list variable eg

    static va_list empty_list = {};
    

    then use empty_list and not NULL as the fifth parameter in the function call at line 206

     return (ipatch_convert_object_to_type_multi_set_vlist (
                     object, type, err, NULL, empty_list));
    

    and then the compiler does not complain and normal servce is resumed

    CC builtin_enums.lo
    CC IpatchConverter.lo
    CC IpatchConverterSF2VoiceCache.lo
    CC IpatchConvert_DLS2.lo
    etc

     

    Last edit: J G Miller 2017-03-21
  • J G Miller

    J G Miller - 2017-03-22

    Newer gcc ie version 5 on Linix Mint 18.1

    gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

    does not like va_list as an empty brace, so "{ 0 } " is needed.

    --- libinstpatch/IpatchConverter.c.orig        2017-03-21 00:04:29.588324041 +0000
    +++ libinstpatch/IpatchConverter.c      2017-03-21 00:04:29.588324041 +0000
    @@ -67,6 +67,8 @@
     static GList *conv_maps = NULL;        /* list of all registered IpatchConverterInfo */
     static gpointer parent_class = NULL;
    
    +static va_list empty_list = { 0 };
    +
    
     /**
    
      * ipatch_convert_objects:
    @@ -203,7 +205,7 @@
     GList *
     ipatch_convert_object_to_type_multi_list (GObject *object, GType type, GError **err)
     {
    -  return (ipatch_convert_object_to_type_multi_set_vlist (object, type, err, NULL, NULL));
    +  return (ipatch_convert_object_to_type_multi_set_vlist (object, type, err, NULL, empty_list));
     }
    
     /**
    
     

Log in to post a comment.

MongoDB Logo MongoDB