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

Fix Old-Style-Cast, Missing override and Possible noexcept

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.15.0
    • Component/s: C++ - Compiler
    • Labels:
      None

      Description

       

      The fixes required are over the warnings reported with a C++ complier (GCC in this case) compiling with the flags -Wsuggest-override and -Wold-style-cast

       

      The GCC built  warnings for both of the flags are as follow:

       

      swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service_types.cpp:3461:42: warning: use of old-style cast to ‘int32_t’ {aka ‘int’} [-Wold-style-cast]
       3461 | xfer += oprot->writeI32((int32_t)this->comp);
       | ^~~~
       | -------------------
       | static_cast<int32_t> (this->comp) 
       
      swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service_types.h:352:56: warning: use of old-style cast to ‘enum SWC::Thrift::KeySeq::type’ [-Wold-style-cast] 352 | Schema() : cid(0), col_name(), col_seq((KeySeq::type)0),
      | ^ | - | static_cast< -- | > (0)
       
      swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service_types.h:319:15: warning: ‘virtual const char* SWC::Thrift::Exception::what() const’ can be marked override [-Wsuggest-overr$ 319 | const char* what() const noexcept;
      
      
      swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service_types.h:591:12: warning: ‘virtual uint32_t SWC::Thrift::SpecSchemas::write(apache::thrift::protocol::TProtocol*) const’ can$ 591 | uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
       
      swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service.h:274:8: warning: ‘virtual void SWC::Thrift::ServiceNull::scan(SWC::Thrift::Cells&, const SWC::Thrift::SpecScan&)’ can be marked override [-Wsuggest-override] 274 | void scan(Cells& /* _return */, const SpecScan& /* spec */) { | ^~~~
      

       

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kashirin.alex Kashirin Alex
                Reporter:
                kashirin.alex Kashirin Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 50m
                  2h 50m