Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-1524

3.2.x - fix signed/unsigned compilation issues in Vec

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.2.4
    • Cleanup, Core
    • None

    Description

      cc1plus: warnings being treated as errors
      Vec.h: In function ‘int main(int, char**)’:
      Vec.h:616: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false
      Vec.h:616: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false

      Alan says:

      It is a result of optimization in the call sequence in test_append that calls str.append(value,len) which calls reserve(length() + count). length() is inlined to a reference to n so the argument is treated as "n+count". This yields, in the reserve method at the bad line

      if (n+count <= n)

      which leads to the warning/error you see. I don't see how to disable the error, though.

      Attachments

        Issue Links

          Activity

            People

              jamespeach James Peach
              jamespeach James Peach
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: