Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 319
    • Issues 319
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #18095
Closed
Open
Created Jan 19, 2016 by teor@teor

Unit test integer precision warnings on 32 bit clang targets

I think legacy/trac#17076 (moved) introduced some integer precision warnings on 32 bit clang targets.

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

01:08:40 src/test/test_options.c:2311:25: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'long' [-Werror,-Wshorten-64-to-32]
01:08:40   tt_int_op(tdata->opt->RelayBandwidthBurst, OP_EQ, 1000);
01:08:40   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01:08:40 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
01:08:40         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
01:08:40                             ^
01:08:40 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
01:08:40         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
01:08:40                                 ^
01:08:40 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
01:08:40         type val1_ = (a);                                               \
01:08:40                       ^
01:08:40 src/test/test_options.c:2319:25: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'long' [-Werror,-Wshorten-64-to-32]
01:08:40   tt_int_op(tdata->opt->RelayBandwidthRate, OP_EQ, 1001);
01:08:40   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01:08:40 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
01:08:40         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
01:08:40                             ^
01:08:40 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
01:08:40         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
01:08:40                                 ^
01:08:40 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
01:08:40         type val1_ = (a);                                               \
01:08:40                       ^
01:08:40 src/test/test_options.c:2350:25: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'long' [-Werror,-Wshorten-64-to-32]
01:08:40   tt_int_op(tdata->opt->BandwidthRate, OP_EQ, 1001);
01:08:40   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
01:08:40 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
01:08:40         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
01:08:40                             ^
01:08:40 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
01:08:40         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
01:08:40                                 ^
01:08:40 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
01:08:40         type val1_ = (a);                                               \
01:08:40                       ^
01:08:40 src/test/test_options.c:2362:25: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'long' [-Werror,-Wshorten-64-to-32]
01:08:40   tt_int_op(tdata->opt->BandwidthBurst, OP_EQ, 1001);
01:08:40   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
01:08:40 ./src/ext/tinytest_macros.h:158:22: note: expanded from macro 'tt_int_op'
01:08:40         tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
01:08:40                             ^
01:08:40 ./src/ext/tinytest_macros.h:144:26: note: expanded from macro 'tt_assert_test_type'
01:08:40         tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,        \
01:08:40                                 ^
01:08:40 ./src/ext/tinytest_macros.h:116:16: note: expanded from macro 'tt_assert_test_fmt_type'
01:08:40         type val1_ = (a);                                               \
01:08:40                       ^
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking