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

Fix some compile warnings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.13.0
    • 0.14.0
    • C glib - Library
    • Patch

    Description

      The compile warnings:

      src/thrift/c_glib/transport/thrift_ssl_socket.c:790:35: warning: pointer targets in passing argument 1 of ‘thrift_ssl_socket_get_error’ differ in signedness [-Wpointer-sign]
      thrift_ssl_socket_get_error("No cipher overlay", THRIFT_SSL_SOCKET_ERROR_CIPHER_NOT_AVAILABLE, error);
      ^~~~~~~~~~~~~~~~~~~
      src/thrift/c_glib/transport/thrift_ssl_socket.c:206:6: note: expected ‘const guchar *’

      {aka ‘const unsigned char *’} but argument is of type ‘char *’
      void thrift_ssl_socket_get_error(const guchar *error_msg, guint thrift_error_no, GError **error)


      src/thrift/c_glib/transport/thrift_ssl_socket.c:309:48: warning: pointer targets in passing argument 2 of ‘thrift_ssl_socket_get_ssl_error’ differ in signedness [-Wpointer-sign]
      thrift_ssl_socket_get_ssl_error(ssl_socket, "Receive error",
      ^~~~~~~~~~~~~~~
      src/thrift/c_glib/transport/thrift_ssl_socket.c:158:6: note: expected ‘const guchar *’ {aka ‘const unsigned char *’}

      but argument is of type ‘char *’
      void thrift_ssl_socket_get_ssl_error(ThriftSSLSocket *socket, const guchar *error_msg, guint thrift_error_no, int ssl_error, GError **error)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/thrift/c_glib/transport/thrift_ssl_socket.c: In function ‘thrift_ssl_socket_write’:
      src/thrift/c_glib/transport/thrift_ssl_socket.c:345:48: warning: pointer targets in passing argument 2 of ‘thrift_ssl_socket_get_ssl_error’ differ in signedness [-Wpointer-sign]
      thrift_ssl_socket_get_ssl_error(ssl_socket, "Send error",
      ^~~~~~~~~~~~
      src/thrift/c_glib/transport/thrift_ssl_socket.c:158:6: note: expected ‘const guchar *’

      {aka ‘const unsigned char *’} but argument is of type ‘char *’
      void thrift_ssl_socket_get_ssl_error(ThriftSSLSocket *socket, const guchar *error_msg, guint thrift_error_no, int ssl_error, GError **error)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/thrift/c_glib/transport/thrift_ssl_socket.c: In function ‘thrift_ssl_socket_handle_handshake’:
      src/thrift/c_glib/transport/thrift_ssl_socket.c:410:48: warning: pointer targets in passing argument 2 of ‘thrift_ssl_socket_get_ssl_error’ differ in signedness [-Wpointer-sign]
      thrift_ssl_socket_get_ssl_error(ssl_socket, "Error while connect/bind", THRIFT_SSL_SOCKET_ERROR_CONNECT_BIND, rc, error);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~
      src/thrift/c_glib/transport/thrift_ssl_socket.c:158:6: note: expected ‘const guchar *’ {aka ‘const unsigned char *’}

      but argument is of type ‘char *’
      void thrift_ssl_socket_get_ssl_error(ThriftSSLSocket *socket, const guchar *error_msg, guint thrift_error_no, int ssl_error, GError **error)

      src/thrift/c_glib/transport/thrift_socket.c: In function ‘thrift_socket_open’:
      src/thrift/c_glib/transport/thrift_socket.c:154:29: warning: passing argument 1 of ‘thrift_socket_close’ from incompatible pointer type [-Wincompatible-pointer-types]
      thrift_socket_close(tsocket, NULL);
      ^~~~~~~
      src/thrift/c_glib/transport/thrift_socket.c:103:39: note: expected ‘ThriftTransport *’

      {aka ‘struct _ThriftTransport *’}

      but argument is of type ‘ThriftSocket *’

      {aka ‘struct _ThriftSocket *’}

      thrift_socket_close (ThriftTransport *transport, GError **error)

      src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c:60:9: warning: implicit declaration of function ‘thrift_protocol_decorator_write_message_begin’; did you mean ‘thrift_protocol_write_message_begin’? [-Wimplicit-function-declaration]
      ret = thrift_protocol_decorator_write_message_begin(protocol, service_name, message_type, seqid, error);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      thrift_protocol_write_message_begin
      src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c: In function ‘thrift_multiplexed_protocol_class_init’:
      src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c:142:28: warning: assignment to ‘gint32 (ThriftProtocol *, const gchar *, const ThriftMessageType, const gint32, GError **)’

      {aka ‘int (*)(struct _ThriftProtocol *, const char *, const enum <anonymous>, const int, struct _GError **)’}

      from incompatible pointer type ‘gint32 (ThriftMultiplexedProtocol *, const gchar *, const ThriftMessageType, const gint32, GError **)’

      {aka ‘int (*)(struct _ThriftMultiplexedProtocol *, const char *, const enum <anonymous>, const int, struct _GError **)’}

      [-Wincompatible-pointer-types]
      cls->write_message_begin = thrift_multiplexed_protocol_write_message_begin;

      Attachments

        Issue Links

          Activity

            People

              wangyunjian wangyunjian
              wangyunjian wangyunjian
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m