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

Disable unsafe-loop-optimizations flag when compiling c++ files

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 5.2.0, 5.0.5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 2
    • Storage - Ra 2021-11-15

      The flag unsafe-loop-optimizations is currently set when GCC version is 4.7, 5.x or 6.x. This triggers a warning when trying to compile c++ files that use range based for loop:

      ../../../test/cppsuite/test_harness/thread_manager.cxx: In destructor 'test_harness::thread_manager::~thread_manager()':
      ../../../test/cppsuite/test_harness/thread_manager.cxx:35:21: error: missed loop optimization, the loop counter may overflow [-Werror=unsafe-loop-optimizations]
           for (auto &it : _workers) { 

      This flag should be disabled when compiling c++ files.

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: