Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2421

test_bloom ret assigned but not used

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • WT2.8.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      alexander.gorrod, there's an oddity in test_bloom.c:

      /*
       * Try out some values we didn't insert - choose a different size to
       * ensure the value doesn't overlap with existing values.
       */
      item.size = g.c_key_max + 10;
      item.data = calloc(item.size, 1);
      memset((void *)item.data, 'a', item.size);
      for (i = 0, fp = 0; i < g.c_ops; i++) {
              ((uint8_t *)item.data)[i % item.size] =
                  'a' + ((uint8_t)rand() % 26);
              if ((ret = __wt_bloom_get(bloomp, &item)) == 0)
                      ++fp;
      }
      

      A value is assigned to ret, but it's never used. I'm not sure what's going on here, so I'm punting it to you.

      There's also a calloc immediately above that isn't checked for failure.

            Assignee:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: