Project

General

Profile

Actions

Fix #48688

closed

rgw_rest_metadata.cc:267:13: warning: address of 'this->ondisk_version' will always evaluate to 'true'

Added by Mark Kogan over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
15.x, 16.x
Reviewed:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The full warning:

[3/10] Building CXX object src/rgw/CMakeFiles/radosgw.dir/rgw_rest_metadata.cc.o
../src/rgw/rgw_rest_metadata.cc:267:13: warning: address of 'this->ondisk_version' will always evaluate to 'true' [-Wpointer-bool-conversion]
                                       &ondisk_version);
                                        ^~~~~~~~~~~~~~

op_ret = store->ctl()->meta.mgr->put(metadata_key, bl, s->yield, sync_type,
      &ondisk_version);
       ^^^^^^^^^^^^^^
--> 
int RGWMetadataManager::put(string& metadata_key, bufferlist& bl,
                optional_yield y,
                            RGWMDLogSyncType sync_type,
                            bool from_remote_zone,
                            ^^^vvv
                            obj_version *existing_version)

Quote:
- - - - - 8< - - - - -
Ronen Friedman
Dec 14, 2020, 1:35 PM (7 days ago)
to me, Casey

Hi,

Seems there's a missing argument in the call to 'put()' in line 266
of this file:

op_ret = store->ctl()->meta.mgr->put(metadata_key, bl, s->yield, sync_type,
&ondisk_version);

The last parameter is taken to be a bool. If this is what it was meant to be, well, the
compiler doesn't like the fact that bool is always true. I assume that the problem is that
the wrong 'put' is selected?

Thanks
Ronen
- - - - - 8< - - - - -

Actions #1

Updated by Mark Kogan over 3 years ago

  • Project changed from Ceph to rgw
Actions #2

Updated by Mark Kogan over 3 years ago

  • Backport set to 15.x, 16.x
  • Affected Versions v15.0.0, v17.0.0 added
Actions #3

Updated by Casey Bodley over 3 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 38674
Actions #4

Updated by Casey Bodley over 3 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF