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

thrift_binary_protocol.c: 'dereferencing type-punned pointer will break strict-aliasing rules'

    XMLWordPrintableJSON

    Details

      Description

      I am trying to compile the project on Linux Arch (gcc 4.9.1) and I see following error:

      libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/cpp/src/thrift -D_FORTIFY_SOURCE=2 -O2 -g -Wall -W -Werror -Isrc -I src/thrift/c_glib -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -MT libthrift_c_glib_la-thrift_binary_protocol.lo -MD -MP -MF .deps/libthrift_c_glib_la-thrift_binary_protocol.Tpo -c src/thrift/c_glib/protocol/thrift_binary_protocol.c -fPIC -DPIC -o .libs/libthrift_c_glib_la-thrift_binary_protocol.o
      src/thrift/c_glib/protocol/thrift_binary_protocol.c: In function 'thrift_binary_protocol_read_i16':
      src/thrift/c_glib/protocol/thrift_binary_protocol.c:672:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
      *value = *(gint16 *) b;
      ^
      src/thrift/c_glib/protocol/thrift_binary_protocol.c: In function 'thrift_binary_protocol_read_i32':
      src/thrift/c_glib/protocol/thrift_binary_protocol.c:691:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
      *value = *(gint32 *) b;
      ^
      src/thrift/c_glib/protocol/thrift_binary_protocol.c: In function 'thrift_binary_protocol_read_i64':
      src/thrift/c_glib/protocol/thrift_binary_protocol.c:710:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
      *value = *(gint64 *) b;
      ^
      src/thrift/c_glib/protocol/thrift_binary_protocol.c: In function 'thrift_binary_protocol_read_double':
      src/thrift/c_glib/protocol/thrift_binary_protocol.c:729:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
      guint64 bits = *(guint64 *) b;
      ^
      cc1: all warnings being treated as errors

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                simonsouth Simon South
                Reporter:
                anatolikus Anatol Pomozov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: