Project

General

Profile

Actions

Bug #19445

closed

client: warning: ‘*’ in boolean context, suggest ‘&&’ instead #14263

Added by Jos Collin about 7 years ago. Updated almost 7 years ago.

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

0%

Source:
Community (dev)
Tags:
client SyntheticClient warning
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The following warning appears during make. Here roll_die and empty() returns bool. This can be easily fixed by removing the value 0.9. But I think this can better be fixed by the person who wrote it, so that the below 'ascend' and 'descend' logic can be preserved.

SyntheticClient.cc: In member function int SyntheticClient::random_walk(int):
SyntheticClient.cc:2659:11: warning: * in boolean context, suggest && instead [-Wint-in-bool-context]
     if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && !subdirs.empty()) {

    // ascend?                                                                                                                          
    if (cwd.depth() && !roll_die(::pow((double).9, (double)cwd.depth()))) {
      dout(DBL) << "die says up" << dendl;
      up();
      continue;
    }

    // descend?                                                                                                                         
    if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && !subdirs.empty()) {
      string s = get_random_subdir();
      cwd.push_dentry( s );
      dout(DBL) << "cd " << s << " -> " << cwd << dendl;
      clear_dir();
      continue;
    }

Actions #1

Updated by Brad Hubbard about 7 years ago

  • Status changed from New to In Progress
  • Assignee changed from Sage Weil to Brad Hubbard
  • Release set to master
Actions #2

Updated by Jos Collin about 7 years ago

  • Status changed from In Progress to Resolved

The PR#14308 is merged.

Actions #3

Updated by Greg Farnum almost 7 years ago

  • Project changed from Ceph to CephFS
  • Category deleted (26)
Actions

Also available in: Atom PDF