Thrift
  1. Thrift
  2. THRIFT-1458

use the C++ standard (c++0x or later c++11) to improve code quality and cross platform capability

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      gcc, llvm, visualstudio

      Description

      The goal is improvment of code quality and cross platform capability.

      I did several test on Debian Squeeze with default packages of gcc(4.4.5) and clang(2.7)

      Thrift Compiler only
      sh bootstrap.sh ; ./configure --without-cpp --without-csharp --without-java --without-erlang --without-python --without-perl --without-php --without-php_extension --without-ruby --without-haskell

      CXX=g++
      => ok
      CXX=g++ CXXFLAGS='-std=c++0x'
      => ok

      CXX=clang++
      => ok
      CXX=clang++ CXXFLAGS='-std=c++0x'
      => fail

      Thrift C++ Library
      sh bootstrap.sh ; ./configure --without-csharp --without-java --without-erlang --without-python --without-perl --without-php --without-php_extension --without-ruby --without-haskell

      CXX=clang++
      => fail
      CXX=clang++ CXXFLAGS='-std=c++0x'
      => fail

      CXX=g++
      => ok
      CXX=g++ CXXFLAGS='-std=c++0x'
      => ok (since THRIFT-1459)

      further info on supported features

        Issue Links

          Activity

          Hide
          Randy Abernethy added a comment -

          Picking up from Ben's comment here:
          https://issues.apache.org/jira/browse/THRIFT-1753?focusedCommentId=13679496&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13679496

          I like the idea. Taking a fresh cut would certainly allow more latitude to really improve things using the full C+11 feature set. Also guarantees existing users are not disturbed. Makes the additional testing burden explicit (which is probably good). On the down side, future C+ patches will need to be duplicated with tweaks for the two branches. Given that C++98 is likely to be important for some time to come this last point is worth considering carefully.

          Show
          Randy Abernethy added a comment - Picking up from Ben's comment here: https://issues.apache.org/jira/browse/THRIFT-1753?focusedCommentId=13679496&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13679496 I like the idea. Taking a fresh cut would certainly allow more latitude to really improve things using the full C+ 11 feature set. Also guarantees existing users are not disturbed. Makes the additional testing burden explicit (which is probably good). On the down side, future C + patches will need to be duplicated with tweaks for the two branches. Given that C++98 is likely to be important for some time to come this last point is worth considering carefully.
          Hide
          Nate Rosenblum added a comment -

          The attached patch produces generated cpp code that will compile cleanly with -std=c+11 and -stdlib=libc+. As discussed in THRIFT-1753

          Show
          Nate Rosenblum added a comment - The attached patch produces generated cpp code that will compile cleanly with -std=c+ 11 and -stdlib=libc + . As discussed in THRIFT-1753
          Hide
          Nate Rosenblum added a comment -

          The 0001-Use-Compatibility... patch more or less exactly duplicates THRIFT-2022. Please feel free to ignore.

          Show
          Nate Rosenblum added a comment - The 0001-Use-Compatibility... patch more or less exactly duplicates THRIFT-2022 . Please feel free to ignore.
          Hide
          Roger Meier added a comment -

          thrift/cxxfunctional.h and namespace tcxx => yes!

          Thanks Nate!

          ;-r

          Show
          Roger Meier added a comment - thrift/cxxfunctional.h and namespace tcxx => yes! Thanks Nate! ;-r
          Hide
          Hudson added a comment -

          Integrated in Thrift #733 (See https://builds.apache.org/job/Thrift/733/)
          THRIFT-1458 cpp: use the C++ standard (c+0x or later c+11) to improve code quality and cross platform capability (Revision bb98ed44d7a7be7f467a5b5112b116d5d0ebd1a7)

          Result = SUCCESS
          roger :
          Files :

          • lib/cpp/src/thrift/cxxfunctional.h
          • compiler/cpp/src/generate/t_cpp_generator.cc
          Show
          Hudson added a comment - Integrated in Thrift #733 (See https://builds.apache.org/job/Thrift/733/ ) THRIFT-1458 cpp: use the C++ standard (c+ 0x or later c +11) to improve code quality and cross platform capability (Revision bb98ed44d7a7be7f467a5b5112b116d5d0ebd1a7) Result = SUCCESS roger : Files : lib/cpp/src/thrift/cxxfunctional.h compiler/cpp/src/generate/t_cpp_generator.cc

            People

            • Assignee:
              Roger Meier
              Reporter:
              Roger Meier
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development