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

cleanup: misc: Warning Elimination #14439

merged 11 commits into from Apr 12, 2017


None yet
4 participants
Copy link

adamemerson commented Apr 10, 2017

Death. Death to the diagnostic.

@adamemerson adamemerson requested a review from tchaikov Apr 10, 2017

@adamemerson adamemerson changed the title Warning Eiimination Warning Elimination Apr 10, 2017

@adamemerson adamemerson force-pushed the adamemerson:wip-warning-sign branch from c89f986 to d1fc05b Apr 10, 2017

@liewegas liewegas changed the title Warning Elimination misc: Warning Elimination Apr 10, 2017

@liewegas liewegas added the cleanup label Apr 10, 2017

@liewegas liewegas added the needs-qa label Apr 10, 2017

adamemerson added some commits Apr 10, 2017

monc: Remove pessimizing move
Calling std::move on on a function returning a value can interfere
with RVO. At best it has no effect, but can actively interfere with
Copy/Move Elision and make code less efficient.

Signed-off-by: Adam C. Emerson <>
osd: The shard_id_t constructor takes an int8_t
So pass it -1 rather than 255 to avoid an implicit conversion warning.

Signed-off-by: Adam C. Emerson <>
msg: Remove pessimizing move
Do not std::move the result of a function returning a value.

(Once could reasonably std::move the result of a function returning an
lvalue reference, but *not* that of one returning a value.)

Signed-off-by: Adam C. Emerson <>
rgw: Make AuthResult::get_completer return rvalue reference
Since we are explicitly moving the completer out of the AuthResult
and allowing the client to have ownership of it, simply return an
rvalue reference rather than moving into a temporary that is itself

Signed-off-by: Adam C. Emerson <>
rgw: Remove pessimizing move of return values
C++ performs copy elision of return values if:

1. The value is a local declared in the function (i.e. not a
2. The type of the value in the return statement is, modulo
   const-value qualification, identical to the return type of the

An RValue reference to a type is not identical, modulo const-value
qualification, to the type it is a reference to.

Do not std::move local values in the return statement unless the value
is a parameter or you will make the compiler perform a copy it would
iotherwise avoid.

Signed-off-by: Adam C. Emerson <>
cls: Fix order of operations of std::string constructor
Presumably the intent was to create a string with 128 '1's, rather than
a string with 49 '\200's.

Signed-off-by: Adam C. Emerson <>
rbd: Remove pessimizing move
Do not std::move returned values.

Signed-off-by: Adam C. Emerson <>
filestore: Fix uninitialized return
In some error conditions we were returning the value of an
uninitialized variable.

Signed-off-by: Adam C. Emerson <>
bluestore: Remove unused expression in statement
Signed-off-by: Adam C. Emerson <>
cmake: Make -Wno-unknown-pragmas common to all compilers
Signed-off-by: Adam C. Emerson <>
librados: Since a pragma push was removed, get rid of that pop
Don't you think the plural of pragma should be pragmata?

Signed-off-by: Adam C. Emerson <>

@adamemerson adamemerson force-pushed the adamemerson:wip-warning-sign branch from d1fc05b to ef94464 Apr 11, 2017

@@ -3267,10 +3267,10 @@ extern "C" int rbd_aio_readv(rbd_image_t image, const struct iovec *iov,
if (r == 0) {
librbd::io::ReadResult read_result;
if (iovcnt == 1) {
read_result = std::move(librbd::io::ReadResult(
static_cast<char *>(iov[0].iov_base), iov[0].iov_len));
read_result = librbd::io::ReadResult(

This comment has been minimized.

Copy link

tchaikov Apr 11, 2017


@dillaman are you good with this change?

This comment has been minimized.

Copy link

dillaman Apr 11, 2017



@tchaikov tchaikov requested a review from dillaman Apr 11, 2017

@liewegas liewegas merged commit 4f210cd into ceph:master Apr 12, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Unmodifed Submodules submodules for project are unmodified
default Build finished.

@theanalyst theanalyst changed the title misc: Warning Elimination cleanup: misc: Warning Elimination Apr 18, 2017

@adamemerson adamemerson deleted the adamemerson:wip-warning-sign branch May 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.