[
https://issues.apache.org/jira/browse/THRIFT-3383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075421#comment-15075421
]
ASF GitHub Bot commented on THRIFT-3383:
----------------------------------------
GitHub user simonsouth opened a pull request:
https://github.com/apache/thrift/pull/764
Thrift 3383 i64 related warnings
These changes reduce the number of compiler warnings, and eliminate all
warnings related to 64-bit values, generated when building the C (GLib) test
suite on a 32-bit platform with a C90-compliant compiler (as gcc was by default
until fairly recently).
This fixes THRIFT-3383. This pull request also includes the fixes for
THRIFT-3498 and THRIFT-3512.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/simonsouth/thrift
thrift-3383-i64-related-warnings
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/764.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #764
----
commit 5fbe84f68871009aaa8adf55579b048c164dd403
Author: Simon South <[email protected]>
Date: 2015-12-21T19:01:36Z
THRIFT-3498 C++ library assumes optional function
pthread_attr_setschedpolicy is available
PosixThreadFactory.cpp: Test for availability of optional
pthread_attr_setschedpolicy function before including in source code
commit 51bf5d83765d7bbea475cf8b6389f3a345d8a572
Author: Simon South <[email protected]>
Date: 2015-12-29T17:02:18Z
THRIFT-3512 c_glib: Build fails due to missing features.h
testbinaryprotocol.c: Include features.h only on platforms with GNU
libc.
commit 4d0efc324ff2919b227f83f4cdc8b99223b18cb9
Author: Simon South <[email protected]>
Date: 2015-12-24T01:29:29Z
c_glib: Compiler: Silence integer-too-large warnings
Wrap output 64-bit integer constants in GLib's G_GINT64_CONSTANT macro
so the generated code will compile without warnings using a
C90-compliant compiler on a 32-bit system.
commit 30e5d461e7f1c8a5d32a8c651011de74f448b619
Author: Simon South <[email protected]>
Date: 2015-12-29T15:43:23Z
c_glib: test: Reduce warnings on 32-bit platforms
Reduce the number of compiler warnings generated when building the C
(GLib) test suite on a 32-bit platform (particularly with a
C90-compliant compiler).
- testbinaryprotocol.c:
- testdebugproto.c: Wrap 64-bit constants in GLib's G_GINT64_CONSTANT
macro.
- testoptionalrequired.c: Replace C++-style comment with C-style
equivalent.
- testserialization.c: Separate variable declarations from code.
- testthrifttestclient.cpp: Use stream operators to output results
(avoiding warnings related to 64-bit values) instead of printf.
----
> i64 related warnings
> ---------------------
>
> Key: THRIFT-3383
> URL: https://issues.apache.org/jira/browse/THRIFT-3383
> Project: Thrift
> Issue Type: Bug
> Components: C glib - Compiler
> Environment: {code}
> gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-suse-linux/4.8/lto-wrapper
> Target: i586-suse-linux
> Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
> --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
> --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
> --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
> --enable-ssp --disable-libssp --disable-plugin
> --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
> --disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib
> --enable-__cxa_atexit --enable-libstdcxx-allocator=new
> --disable-libstdcxx-pch --enable-version-specific-runtime-libs
> --enable-linker-build-id --enable-linux-futex --program-suffix=-4.8
> --without-system-libunwind --with-arch-32=i586 --with-tune=generic
> --build=i586-suse-linux --host=i586-suse-linux
> Thread model: posix
> gcc version 4.8.3 20140627 [gcc-4_8-branch revision 212064] (SUSE Linux)
> {code}
> Reporter: Jens Geyer
> Assignee: Simon South
> Priority: Minor
>
> I get multiple warnings all related to i64 constants:
> * warning: this decimal constant is unsigned only in ISO C90 (enabled by
> default)
> * warning: integer constant is too large for 'long' type (-Wlong-long)
> {code}
> /bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I../../.. -I../../../lib/cpp/src/thrift -I../src -Wno-unused-function -g
> -Wall -Wextra -pedantic -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT
> gen-c_glib/libtestgenc_la-t_test_debug_proto_test_types.lo -MD -MP -MF
> gen-c_glib/.deps/libtestgenc_la-t_test_debug_proto_test_types.Tpo -c -o
> gen-c_glib/libtestgenc_la-t_test_debug_proto_test_types.lo `test -f
> 'gen-c_glib/t_test_debug_proto_test_types.c' || echo
> './'`gen-c_glib/t_test_debug_proto_test_types.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../..
> -I../../../lib/cpp/src/thrift -I../src -Wno-unused-function -g -Wall -Wextra
> -pedantic -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -MT
> gen-c_glib/libtestgenc_la-t_test_debug_proto_test_types.lo -MD -MP -MF
> gen-c_glib/.deps/libtestgenc_la-t_test_debug_proto_test_types.Tpo -c
> gen-c_glib/t_test_debug_proto_test_types.c -fPIC -DPIC -o
> gen-c_glib/.libs/libtestgenc_la-t_test_debug_proto_test_types.o
> gen-c_glib/t_test_debug_proto_test_types.c: In function
> 't_test_one_of_each_instance_init':
> gen-c_glib/t_test_debug_proto_test_types.c:1271:3: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> object->integer64 = 10000000000;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c: In function
> 't_test_compact_test_constant_i64_list250_constant':
> gen-c_glib/t_test_debug_proto_test_types.c:16023:5: warning: this decimal
> constant is unsigned only in ISO C90 [enabled by default]
> gint64 compact_test_constant_i64_list250256 = 4294967295;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16024:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_list250257 = 1099511627775;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16025:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_list250258 = 281474976710655;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16026:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_list250259 = 72057594037927935;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16027:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_list250260 = 9223372036854775807;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c: In function
> 't_test_compact_test_constant_i64_set294_constant':
> gen-c_glib/t_test_debug_proto_test_types.c:16206:5: warning: this decimal
> constant is unsigned only in ISO C90 [enabled by default]
> gint64 compact_test_constant_i64_set294300 = 4294967295;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16207:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_set294301 = 1099511627775;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16208:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_set294302 = 281474976710655;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16209:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_set294303 = 72057594037927935;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c:16210:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> gint64 compact_test_constant_i64_set294304 = 9223372036854775807;
> ^
> gen-c_glib/t_test_debug_proto_test_types.c: In function
> 't_test_compact_test_constant':
> gen-c_glib/t_test_debug_proto_test_types.c:16545:5: warning: integer constant
> is too large for 'long' type [-Wlong-long]
> constant->a_i64 = 1099511627775;
> ^
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)