You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2015/07/24 21:41:05 UTC

[jira] [Commented] (THRIFT-3260) multiple warnings in c_glib tutorial

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

Jens Geyer commented on THRIFT-3260:
------------------------------------

Hi [~simonsouth],

thanks for taking over so quickly. After filing this ticket I later realized that it is not only the tutorial - there are some more of these warnings (some not listed above) with the tests. 


> multiple warnings in c_glib tutorial
> ------------------------------------
>
>                 Key: THRIFT-3260
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3260
>             Project: Thrift
>          Issue Type: Bug
>          Components: C glib - Library
>            Reporter: Jens Geyer
>            Assignee: Simon South
>
> {code}
> In file included from gen-c_glib/calculator.c:8:0:
> ../../lib/c_glib/src/thrift/c_glib/thrift.h:38:8: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
>  #endif // #ifndef _THRIFT_THRIFT_H
>         ^
> ../../lib/c_glib/src/thrift/c_glib/thrift.h:38:8: warning: (this will be reported only once per input file) [enabled by default]
> In file included from gen-c_glib/calculator.h:12:0,
>                  from gen-c_glib/calculator.c:10:
> gen-c_glib/tutorial_types.h:95:31: warning: comma at end of enumerator list [-Wpedantic]
>    INVALID_OPERATION_ERROR_CODE,
>                                ^
> gen-c_glib/calculator.c:68:79: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
>                                                  calculator_if_interface_init));
>                                                                                ^
> gen-c_glib/calculator.c: In function 'calculator_client_recv_ping':
> gen-c_glib/calculator.c:121:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>      ThriftApplicationException *xception = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
>      ^
> gen-c_glib/calculator.c: In function 'calculator_client_recv_add':
> gen-c_glib/calculator.c:292:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>      ThriftApplicationException *xception = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
>      ^
> gen-c_glib/calculator.c: In function 'calculator_client_recv_calculate':
> gen-c_glib/calculator.c:477:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>      ThriftApplicationException *xception = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
>      ^
> gen-c_glib/calculator.c: In function 'calculator_client_init':
> gen-c_glib/calculator.c:672:43: warning: unused parameter 'client' [-Wunused-parameter]
>  calculator_client_init (CalculatorClient *client)
>                                            ^
> gen-c_glib/calculator.c: In function 'calculator_client_class_init':
> gen-c_glib/calculator.c:677:54: warning: unused parameter 'cls' [-Wunused-parameter]
>  calculator_client_class_init (CalculatorClientClass *cls)
>                                                       ^
> gen-c_glib/calculator.c: At top level:
> gen-c_glib/calculator.c:688:98: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
>                                                  calculator_handler_calculator_if_interface_init));
>                                                                                                   ^
> gen-c_glib/calculator.c:750:46: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
>                 TYPE_SHARED_SERVICE_PROCESSOR);
>                                               ^
> gen-c_glib/calculator.c: In function 'calculator_processor_process_ping':
> gen-c_glib/calculator.c:802:7: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>        ThriftApplicationException *xception =
>        ^
> gen-c_glib/calculator.c: In function 'calculator_processor_process_add':
> gen-c_glib/calculator.c:898:7: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>        ThriftApplicationException *xception =
>        ^
> gen-c_glib/calculator.c: In function 'calculator_processor_process_calculate':
> gen-c_glib/calculator.c:1014:9: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>          ThriftApplicationException *xception =
>          ^
> gen-c_glib/calculator.c: In function 'calculator_processor_process_zip':
> gen-c_glib/calculator.c:1087:7: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>        ThriftApplicationException *xception =
>        ^
> gen-c_glib/calculator.c: In function 'calculator_processor_dispatch_call':
> gen-c_glib/calculator.c:1133:20: warning: ISO C forbids assignment between function pointer and 'void *' [-Wpedantic]
>    process_function = g_hash_table_lookup (self->process_map, method_name);
>                     ^
> gen-c_glib/calculator.c: In function 'calculator_processor_init':
> gen-c_glib/calculator.c:1231:24: warning: ISO C forbids passing argument 3 of 'g_hash_table_insert' between function pointer and 'void *' [-Wpedantic]
>                         calculator_processor_process_ping);
>                         ^
> In file included from /usr/include/glib-2.0/glib.h:50:0,
>                  from ../../lib/c_glib/src/thrift/c_glib/thrift.h:27,
>                  from gen-c_glib/calculator.c:8:
> /usr/include/glib-2.0/glib/ghash.h:67:13: note: expected 'gpointer' but argument is of type 'gboolean (*)(struct CalculatorProcessor *, gint32,  struct ThriftProtocol *, struct ThriftProtocol *, struct GError **)'
>  gboolean    g_hash_table_insert            (GHashTable     *hash_table,
>              ^
> gen-c_glib/calculator.c:1234:24: warning: ISO C forbids passing argument 3 of 'g_hash_table_insert' between function pointer and 'void *' [-Wpedantic]
>                         calculator_processor_process_add);
>                         ^
> In file included from /usr/include/glib-2.0/glib.h:50:0,
>                  from ../../lib/c_glib/src/thrift/c_glib/thrift.h:27,
>                  from gen-c_glib/calculator.c:8:
> /usr/include/glib-2.0/glib/ghash.h:67:13: note: expected 'gpointer' but argument is of type 'gboolean (*)(struct CalculatorProcessor *, gint32,  struct ThriftProtocol *, struct ThriftProtocol *, struct GError **)'
>  gboolean    g_hash_table_insert            (GHashTable     *hash_table,
>              ^
> gen-c_glib/calculator.c:1237:24: warning: ISO C forbids passing argument 3 of 'g_hash_table_insert' between function pointer and 'void *' [-Wpedantic]
>                         calculator_processor_process_calculate);
>                         ^
> In file included from /usr/include/glib-2.0/glib.h:50:0,
>                  from ../../lib/c_glib/src/thrift/c_glib/thrift.h:27,
>                  from gen-c_glib/calculator.c:8:
> /usr/include/glib-2.0/glib/ghash.h:67:13: note: expected 'gpointer' but argument is of type 'gboolean (*)(struct CalculatorProcessor *, gint32,  struct ThriftProtocol *, struct ThriftProtocol *, struct GError **)'
>  gboolean    g_hash_table_insert            (GHashTable     *hash_table,
>              ^
> gen-c_glib/calculator.c:1240:24: warning: ISO C forbids passing argument 3 of 'g_hash_table_insert' between function pointer and 'void *' [-Wpedantic]
>                         calculator_processor_process_zip);
>                         ^
> In file included from /usr/include/glib-2.0/glib.h:50:0,
>                  from ../../lib/c_glib/src/thrift/c_glib/thrift.h:27,
>                  from gen-c_glib/calculator.c:8:
> /usr/include/glib-2.0/glib/ghash.h:67:13: note: expected 'gpointer' but argument is of type 'gboolean (*)(struct CalculatorProcessor *, gint32,  struct ThriftProtocol *, struct ThriftProtocol *, struct GError **)'
>  gboolean    g_hash_table_insert            (GHashTable     *hash_table,
>              ^
> {code}
> and
> {code}
> In file included from gen-c_glib/shared_service.c:8:0:
> ../../lib/c_glib/src/thrift/c_glib/thrift.h:38:8: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
>  #endif // #ifndef _THRIFT_THRIFT_H
>         ^
> ../../lib/c_glib/src/thrift/c_glib/thrift.h:38:8: warning: (this will be reported only once per input file) [enabled by default]
> gen-c_glib/shared_service.c:50:83: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
>                                                  shared_service_if_interface_init));
>                                                                                    ^
> gen-c_glib/shared_service.c: In function 'shared_service_client_recv_get_struct':
> gen-c_glib/shared_service.c:154:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>      ThriftApplicationException *xception = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
>      ^
> gen-c_glib/shared_service.c: At top level:
> gen-c_glib/shared_service.c:318:106: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
>                                                  shared_service_handler_shared_service_if_interface_init));
>                                                                                                           ^
> gen-c_glib/shared_service.c:353:47: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
>                 THRIFT_TYPE_DISPATCH_PROCESSOR);
>                                                ^
> gen-c_glib/shared_service.c: In function 'shared_service_processor_process_get_struct':
> gen-c_glib/shared_service.c:418:7: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>        ThriftApplicationException *xception =
>        ^
> gen-c_glib/shared_service.c: In function 'shared_service_processor_dispatch_call':
> gen-c_glib/shared_service.c:471:20: warning: ISO C forbids assignment between function pointer and 'void *' [-Wpedantic]
>    process_function = g_hash_table_lookup (self->process_map, method_name);
>                     ^
> gen-c_glib/shared_service.c: In function 'shared_service_processor_init':
> gen-c_glib/shared_service.c:566:24: warning: ISO C forbids passing argument 3 of 'g_hash_table_insert' between function pointer and 'void *' [-Wpedantic]
>                         shared_service_processor_process_get_struct);
>                         ^
> In file included from /usr/include/glib-2.0/glib.h:50:0,
>                  from ../../lib/c_glib/src/thrift/c_glib/thrift.h:27,
>                  from gen-c_glib/shared_service.c:8:
> /usr/include/glib-2.0/glib/ghash.h:67:13: note: expected 'gpointer' but argument is of type 'gboolean (*)(struct SharedServiceProcessor *, gint32,  struct ThriftProtocol *, struct ThriftProtocol *, struct GError **)'
>  gboolean    g_hash_table_insert            (GHashTable     *hash_table,
>              ^
> {code}
> and
> {code}
> In file included from c_glib_server.c:25:0:
> ../../lib/c_glib/src/thrift/c_glib/thrift.h:38:8: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
>  #endif // #ifndef _THRIFT_THRIFT_H
>         ^
> ../../lib/c_glib/src/thrift/c_glib/thrift.h:38:8: warning: (this will be reported only once per input file) [enabled by default]
> In file included from gen-c_glib/calculator.h:12:0,
>                  from c_glib_server.c:34:
> gen-c_glib/tutorial_types.h:95:31: warning: comma at end of enumerator list [-Wpedantic]
>    INVALID_OPERATION_ERROR_CODE,
>                                ^
> c_glib_server.c:103:40: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
>                 TYPE_CALCULATOR_HANDLER);
>                                         ^
> c_glib_server.c: In function ‘tutorial_calculator_handler_calculate’:
> c_glib_server.c:178:3: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>    TutorialCalculatorHandler *self;
>    ^
> c_glib_server.c: In function ‘tutorial_calculator_handler_get_struct’:
> c_glib_server.c:305:3: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
>    gint key = (gint)key32;
>    ^
> {code}
> and a whole lot more.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)