Skip to content

Fix build warnings in perf/small.cc #42

@alyapunov

Description

@alyapunov

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    code healthImprove code readability, simplify maintenance and so on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions