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
merged 11 commits into from Apr 12, 2017

Conversation

Projects
None yet
4 participants
@adamemerson
Copy link
Contributor

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 <aemerson@redhat.com>
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 <aemerson@redhat.com>
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 <aemerson@redhat.com>
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
returned.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
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
   parameter)
2. The type of the value in the return statement is, modulo
   const-value qualification, identical to the return type of the
   function.

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 <aemerson@redhat.com>
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 <aemerson@redhat.com>
rbd: Remove pessimizing move
Do not std::move returned values.

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

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
bluestore: Remove unused expression in statement
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
cmake: Make -Wno-unknown-pragmas common to all compilers
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
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 <aemerson@redhat.com>

@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

tchaikov Apr 11, 2017

Contributor

@dillaman are you good with this change?

This comment has been minimized.

Copy link
@dillaman

dillaman Apr 11, 2017

Contributor

👍

@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
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@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.