Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1695

allow warning-free compilation in VS 2012 and GNU 4.6

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9
    • 0.9.1
    • C++ - Library
    • Windows and any Unix

    • Patch Available

    Description

      The patches allow the current trunk of Thrift C++ to
      build without warnings in Visual Studio and GNU gcc.

      I introduce THRIFT_SAFE_CAST in Thrift.h, which tests narrowing
      conversions for fit. Would-be overflows throw std::runtime_error.

      Some functions have been modified or overloaded to allow size_t
      parameters. SOCKET is dealt with intelligently.

      IMO every public thrift function should have a form accepting normal
      types – including e.g. short, int, long, and size_t – and apply casts
      as necessary. In particular size_t is important because std
      constainers have size() members that usually return something like
      size_t.

      Attachments

        1. thrift.warningfree.pax.gz
          8 kB
          James K. Lowden
        2. platform_direct.patch
          0.4 kB
          Ben Craig
        3. libthrift_warning_purge.patch
          40 kB
          Ben Craig
        4. compiler_warning_purge.patch
          9 kB
          Ben Craig
        5. compiler_unused_locals.patch
          2 kB
          Ben Craig
        6. compiler_switch_default.patch
          5 kB
          Ben Craig
        7. compiler_is_dir.patch
          2 kB
          Ben Craig

        Activity

          People

            roger Roger Meier
            jklowden James K. Lowden
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified