Project

General

Profile

Actions

Bug #63409

open

rgw_file.cc:348:7: warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute

Added by Casey Bodley 6 months ago. Updated 6 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
rgw_file backport_processed
Backport:
quincy reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

reported by Leonid Usov in #ceph-devel slack:

ceph/src/rgw/rgw_file.cc:348:7: warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute [-Wunused-value]
      lock_guard(rgw_fh->mtx);
      ^~~~~~~~~~~~~~~~~~~~~~~

    if ((rc == 0) &&
        ((rc = req.get_ret()) == 0)) {
      lock_guard(rgw_fh->mtx);
      rgw_fh->set_atime(real_clock::to_timespec(real_clock::now()));
      *bytes_read = req.nread;
    }

could it be that the code is not protected? I think this is the case on the latest llvm compiler at least.

Related issues 2 (2 open0 closed)

Copied to rgw - Backport #63423: reef: rgw_file.cc:348:7: warning: ignoring temporary created by a constructor declared with 'nodiscard' attributeNewMatt BenjaminActions
Copied to rgw - Backport #63424: quincy: rgw_file.cc:348:7: warning: ignoring temporary created by a constructor declared with 'nodiscard' attributeNewMatt BenjaminActions
Actions #1

Updated by Matt Benjamin 6 months ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 54309
Actions #2

Updated by Casey Bodley 6 months ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to quincy reef
Actions #3

Updated by Backport Bot 6 months ago

  • Copied to Backport #63423: reef: rgw_file.cc:348:7: warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute added
Actions #4

Updated by Backport Bot 6 months ago

  • Copied to Backport #63424: quincy: rgw_file.cc:348:7: warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute added
Actions #5

Updated by Backport Bot 6 months ago

  • Tags changed from rgw_file to rgw_file backport_processed
Actions

Also available in: Atom PDF