[ 
https://issues.apache.org/jira/browse/THRIFT-4622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16596238#comment-16596238
 ] 

ASF GitHub Bot commented on THRIFT-4622:
----------------------------------------

jeking3 closed pull request #1582: THRIFT-4622: Resolve typedef'd list elements 
(C (GLib))
URL: https://github.com/apache/thrift/pull/1582
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc 
b/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
index b27fc6099d..b1e80421d6 100644
--- a/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
@@ -579,7 +579,7 @@ string t_c_glib_generator::type_name(t_type* ttype, bool 
in_typedef, bool is_con
       // TODO: discuss whether or not to implement TSet, THashSet or GHashSet
       cname = "GHashTable";
     } else if (ttype->is_list()) {
-      t_type* etype = ((t_list*)ttype)->get_elem_type();
+      t_type* etype = get_true_type(((t_list*)ttype)->get_elem_type());
       if (etype->is_void()) {
         throw std::runtime_error("compiler error: list element type cannot be 
void");
       }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> glibC compilation issue
> -----------------------
>
>                 Key: THRIFT-4622
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4622
>             Project: Thrift
>          Issue Type: Bug
>          Components: C glib - Compiler, C glib - Library
>    Affects Versions: 0.11.0
>         Environment: Thrift 0.11.0
> glib 2.0
>            Reporter: Gowrishankar Murali
>            Assignee: Simon South
>            Priority: Minor
>             Fix For: 0.12.0
>
>
> {color:#707070}*Generated glibC files results in compiler error.*{color}
> /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’
>  
> {color:#707070}The Generated code resulting in the error:{color}
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to