Opened 5 years ago

Closed 5 years ago

#12691 closed defect (fixed)

does not build with clang

Reported by: weasel Owned by:
Priority: Medium Milestone: Tor: 0.2.6.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

On master, tor's test suite does not build with clang on i386. The 0.2.5.x tree is fine.

From https://jenkins.torproject.org/job/tor-ci-linux-master-clang/ARCHITECTURE=i386,SUITE=sid/6/console:

19:56:16 src/test/test_util.c:2407:13: error: implicit conversion loses integer precision: 'off_t' (aka 'long long') to 'long' [-Werror,-Wshorten-64-to-32]
19:56:16   tt_int_op(tor_fd_getpos(fd), ==, strlen(message));
19:56:16   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19:56:16 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
19:56:16         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
19:56:16                             ^
19:56:16 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
19:56:16         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
19:56:16                                 ^
19:56:16 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
19:56:16         type val1_ = (a);                                               \
19:56:16                       ^
19:56:16 src/test/test_util.c:2409:16: error: implicit conversion loses integer precision: '__off64_t' (aka 'long long') to 'long' [-Werror,-Wshorten-64-to-32]
19:56:16   tt_int_op(st.st_size, ==, strlen(message));
19:56:16   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19:56:16 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
19:56:16         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
19:56:16                             ^
19:56:16 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
19:56:16         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
19:56:16                                 ^
19:56:16 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
19:56:16         type val1_ = (a);                                               \
19:56:16                       ^
19:56:16 src/test/test_util.c:2413:13: error: implicit conversion loses integer precision: 'off_t' (aka 'long long') to 'long' [-Werror,-Wshorten-64-to-32]
19:56:16   tt_int_op(tor_fd_getpos(fd), ==, 0);
19:56:16   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
19:56:16 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
19:56:16         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
19:56:16                             ^
19:56:16 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
19:56:16         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
19:56:16                                 ^
19:56:16 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
19:56:16         type val1_ = (a);                                               \
19:56:16                       ^
19:56:16 src/test/test_util.c:2415:16: error: implicit conversion loses integer precision: '__off64_t' (aka 'long long') to 'long' [-Werror,-Wshorten-64-to-32]
19:56:16   tt_int_op(st.st_size, ==, 0);
19:56:16   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
19:56:16 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
19:56:16         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
19:56:16                             ^
19:56:16 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
19:56:16         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
19:56:16                                 ^
19:56:16 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
19:56:16         type val1_ = (a);                                               \
19:56:16                       ^
19:56:16 src/test/test_util.c:2420:13: error: implicit conversion loses integer precision: 'off_t' (aka 'long long') to 'long' [-Werror,-Wshorten-64-to-32]
19:56:16   tt_int_op(tor_fd_getpos(fd), ==, strlen(message2));
19:56:16   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19:56:16 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
19:56:16         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
19:56:16                             ^
19:56:16 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
19:56:16         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
19:56:16                                 ^
19:56:16 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
19:56:16         type val1_ = (a);                                               \
19:56:16                       ^
19:56:16 src/test/test_util.c:2422:16: error: implicit conversion loses integer precision: '__off64_t' (aka 'long long') to 'long' [-Werror,-Wshorten-64-to-32]
19:56:16   tt_int_op(st.st_size, ==, strlen(message2));
19:56:16   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19:56:16 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
19:56:16         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
19:56:16                             ^
19:56:16 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
19:56:16         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
19:56:16                                 ^
19:56:16 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
19:56:16         type val1_ = (a);                                               \
19:56:16                       ^
19:56:16 6 errors generated.

Child Tickets

Attachments (1)

0001-Cast-long-long-arguments-to-int-for-tt_int_op.patch (1.6 KB) - added by weasel 5 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 5 years ago by weasel

Status: newneeds_review

comment:2 Changed 5 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

merged to master; thanks!

Note: See TracTickets for help on using tickets.