Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warnings in perf/small.cc #42

Open
alyapunov opened this issue Nov 17, 2021 · 0 comments
Open

Fix build warnings in perf/small.cc #42

alyapunov opened this issue Nov 17, 2021 · 0 comments
Assignees
Labels
code health Improve code readability, simplify maintenance and so on

Comments

@alyapunov
Copy link
Contributor

When I build RelWithDebInfo I have the following errors (gcc 9.4):

/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc: In function ‘void generate_benchmark_args(benchmark::internal::Benchmark*)’:
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:268:10: warning: narrowing conversion of ‘size’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  268 |          size, objsize_arr[j].size_min,
      |          ^~~~
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:268:10: warning: narrowing conversion of ‘size’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:268:31: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::size_min’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  268 |          size, objsize_arr[j].size_min,
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:268:31: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::size_min’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:269:25: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::size_max’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  269 |          objsize_arr[j].size_max,
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:269:25: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::size_max’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
[ 29%] Linking C static library libjson.a
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:270:25: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::prealloc’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  270 |          objsize_arr[j].prealloc,
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:270:25: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::prealloc’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:271:25: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::mask’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  271 |          objsize_arr[j].mask,
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:271:25: warning: narrowing conversion of ‘objsize_arr.std::array<becnhmark_args, 2>::operator[](((std::array<becnhmark_args, 2>::size_type)j)).becnhmark_args::mask’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:272:10: warning: narrowing conversion of ‘k’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  272 |          k
      |          ^
/home/alyapunov/Work/tarantool/src/lib/small/perf/small.cc:272:10: warning: narrowing conversion of ‘k’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
@kyukhin kyukhin added the code health Improve code readability, simplify maintenance and so on label Oct 28, 2022
@kyukhin kyukhin assigned alyapunov and unassigned EvgenyMekhanik Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Improve code readability, simplify maintenance and so on
Projects
None yet
Development

No branches or pull requests

3 participants