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

glibC compilation issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.11.0
    • 0.12.0
    • None
    • Thrift 0.11.0

      glib 2.0

    Description

      Generated glibC files results in compiler error.

      /usr/include/glib-2.0/glib/garray.h:88:9: note: expected ‘GArray * {aka struct _GArray *}’ but argument is of type ‘GPtrArray * {aka struct _GPtrArray *}’
      GArray* g_array_append_vals (GArray *array,
      ^
      ../gen-c_glib/c__h_w_handling_h_d_handling_types.c: In function ‘c_h_w_handling_image_info_write’:
      /usr/include/glib-2.0/glib/garray.h:67:54: error: ‘GPtrArray {aka struct _GPtrArray}’ has no member named ‘data’
      #define g_array_index(a,t,i) (((t*) (void *) (a)->data) [(i)])
      ^
      ../gen-c_glib/c__h_w_handling_h_d__handling_types.c:198:56: note: in expansion of macro ‘g_array_index’

       

      The Generated code resulting in the error:

      if ((ret = thrift_protocol_write_i16 (protocol, (g_array_index (this_object->image, gint16, i1)), error)) < 0)
      return -1;

      .thrift code generating this

      struct ImageInfo

      { 1: list<int16> image; 2: optional int16 size_h; 3: optional int16 size_v; }

       

      Here the int16 is typedef from i16. 

      When i replace int16 with i16, the error is solved. 

      Will update when I find the reason

      Attachments

        Issue Links

          Activity

            People

              simonsouth Simon South
              Gowri4950 Gowrishankar Murali
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: