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

kv/RocksDBStore: use vector instead of VLA for holding slices #16615

Merged
merged 1 commit into from Jul 28, 2017

Conversation

Projects
None yet
5 participants
@tchaikov
Contributor

tchaikov commented Jul 27, 2017

clang complains:

ceph/src/kv/RocksDBStore.cc:611:32: error: variable length array of
non-POD element type
'rocksdb::Slice'
rocksdb::Slice value_slices[to_set_bl.buffers().size()];

and i believe GCC will also complains with: -Wvla or -pedantic. as
to_set_bl.buffers().size() is not a const expr at compile time.

Signed-off-by: Kefu Chai kchai@redhat.com

kv/RocksDBStore: use vector instead of VLA for holding slices
clang complains:

ceph/src/kv/RocksDBStore.cc:611:32: error: variable length array of
non-POD element type
      'rocksdb::Slice'
    rocksdb::Slice value_slices[to_set_bl.buffers().size()];

and i believe GCC will also complains with: -Wvla or -pedantic. as
to_set_bl.buffers().size() is not a const expr at compile time.

Signed-off-by: Kefu Chai <kchai@redhat.com>
@wjwithagen

This comment has been minimized.

Contributor

wjwithagen commented Jul 27, 2017

@tchaikov
Ah great, I will test this as soon as I have completed building a new FreeBSD port version.

@wjwithagen

Compiles find with Clang 4.0.0.
http://cephdev.digiware.nl:8180/jenkins/job/ceph-master/1019/console
Errors is due to non-writable directory, which also checks out to be a working test.

@yuriw yuriw merged commit 26d120d into ceph:master Jul 28, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@tchaikov tchaikov deleted the tchaikov:wip-no-vla-in-cxx branch Jul 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment