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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • WT10.0.1, 5.2.0, 5.0.5
    • None
    • None
    • 2
    • Storage - Ra 2021-11-15

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: