Repository navigation
Remove unused variables - #73925
Remove unused variables#73925MaxKellermann wants to merge 33 commits into
Conversation
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
The variable is only used to keep the object recorders locked until the end of the scope. Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Mark the variables which are only used with WITH_RADOSGW_RADOS [[maybe_unused]] to avoid warnings when building rgw-standalone-admin. Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Max Kellermann <[email protected]>
|
@chardan Please review RGW portions and common code for RGW. |
chardan
left a comment
There was a problem hiding this comment.
+1 LGTM. I only had one small concern, take a peek and see what you think. Otherwise, looks great! It's really nice to see this sort of thing being done.
| case SYNCLIENT_MODE_CREATESHARED: | ||
| { | ||
| string sarg1 = get_sarg(0); | ||
| get_sarg(0); // skip unused argument |
There was a problem hiding this comment.
Sadly, in C++23 there's not a great say to say "ignore the result", and it does look like get_sarg() is effectful on the object. The most idiomatic way I know of is to cast it to void:
static_cast(get_sarg(0)) or (void)get_sarg(0);
I think either is a bit better than a comment, and has additionally will suppress ignored-return warnings, which may fit in with the spirit of this warning-eliminating PR. Give it a thought!
There was a problem hiding this comment.
It's your call, I'll change this to whatever you believe is better, but:
- get_sarg() is not
[[nodiscard]], thus adding a void cast does nothing at all; there's no warning to be suppressed; "ignore the result" is the compiler default for function calls where the result isn't used - IMHO the comment is useful to explain why this call exists at all (since the method has a slightly confusing name;
take_sargwould be less ambiguous, expressing that the method isn't just a "pure" getter)
There was a problem hiding this comment.
1)You're right, as it's not marked [[nodiscard]] it's the same behavior we've had since the dawn of time. I should have read more carefully.
Nonetheless, I do prefer a cast to void over a comment as it is an explicit signal you intend to call a function and deliberately ignore the return value.
- Re-reading your comment, you were pointing at the side-effect anyway (as you've re-stated). So one option-- honestly probably better than any of this, other than the time involved-- would be to go maybe a little beyond the PR mandate (I'm cool with it, we have a clear purpose in mind) and split get_sarg() into two operations. Then there's no need for a comment or annotation at all.
I already approved the PR, you don't have to do any of those if you don't want to, I'm already ok with it.
|
@MaxKellermann Thank you for reviewing this pull request! As a member of the Ceph organization, please add yourself to |
See #72914 |
| unsigned i = 0; | ||
|
|
||
| if (trimmed_path == "") { | ||
| std::string trimmed_path = path.get_trimmed_path(); |
There was a problem hiding this comment.
This trimmed_path is hiding the outer one. The correct change would be to just set trimmed_path here
There was a problem hiding this comment.
Depends on your definition of "correct". What you suggest would change the behavior of this piece of code.
Yet I know what you mean; the current behavior is obviously buggy, not what the author intended to do.
idryomov
left a comment
There was a problem hiding this comment.
Ack from the RBD perspective
Fix
-Wunused-variableacross the tree.Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.