Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1925

c_glib generated code does not compile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8, 0.9
    • 0.9.3
    • C glib - Compiler
    • None
    • Linux wintermute 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

      gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)

    Description

      I am trying to build the Hypertable thrift bindings for C_glib, but the generated files fail to compile.

      Here is the error message:

      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c: In function ‘result_as_arrays_read’:
      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c:2708:19: warning: passing argument 1 of ‘g_ptr_array_add’ from incompatible pointer type [enabled by default]
      In file included from /usr/include/glib-2.0/glib.h:33:0,
                       from /usr/include/glib-2.0/gobject/gbinding.h:30,
                       from /usr/include/glib-2.0/glib-object.h:25,
                       from /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.h:11,
                       from /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c:8:
      /usr/include/glib-2.0/glib/garray.h:139:12: note: expected ‘struct GPtrArray *’ but argument is of type ‘struct GPtrArray **’
      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c: In function ‘result_as_arrays_write’:
      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c:2854:140: warning: dereferencing ‘void *’ pointer [enabled by default]
      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c:2854:140: error: request for member ‘len’ in something not a structure or union
      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c:2858:78: warning: dereferencing ‘void *’ pointer [enabled by default]
      /home/chris/ht/hypertable/src/c/ThriftClient/gen-c_glib/client_types.c:2858:78: error: request for member ‘len’ in something not a structure or union
      make[2]: *** [src/c/ThriftClient/CMakeFiles/HyperThriftC.dir/gen-c_glib/client_types.c.o] Error 1
      make[1]: *** [src/c/ThriftClient/CMakeFiles/HyperThriftC.dir/all] Error 2
      make: *** [all] Error 2
      

      Here is client_types.c:2858:

      for (i=0; i<g_ptr_array_index ((GPtrArray *) this_object->cells, i)->len; i++)
      

      I added another casst to GPtrArray *, and then the code compiles:

      for (i=0; i<((GPtrArray *)(g_ptr_array_index ((GPtrArray *) this_object->cells, i)))->len; i++)
      

      Attachments

        Issue Links

          Activity

            People

              simonsouth Simon South
              cruppstahl Christoph Rupp
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: