Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3942

MemoryOutputStream yields a compiler warning

    XMLWordPrintableJSON

Details

    Description

      Upon building with clang, MemoryOutputStream raises a compilation warning:

       

       

      /home/parallels/workspace/avro/lang/c++/impl/Stream.cc:129:27: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
        120 | class MemoryOutputStream : public OutputStream {
            |                          final
        121 | public:
        122 |     const size_t chunkSize_;
        123 |     std::vector<uint8_t *> data_;
        124 |     size_t available_;
        125 |     size_t byteCount_;
        126 |
        127 |     explicit MemoryOutputStream(size_t chunkSize) : chunkSize_(chunkSize),
        128 |                                                     available_(0), byteCount_(0) {}
        129 |     ~MemoryOutputStream() final {
            |                           ^
      /home/parallels/workspace/avro/lang/c++/impl/Stream.cc:120:7: note: mark 'avro::MemoryOutputStream' as 'final' to silence this warning
        120 | class MemoryOutputStream : public OutputStream {
            |       ^
       
      

       

      It should be fixed by either marking the class as `final` or removing `final` keyword from destructor. I think the most logical one is the former. I can do this if there're no objections.

      Attachments

        Issue Links

          Activity

            People

              mkmkme Mikhail Koviazin
              mkmkme Mikhail Koviazin
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 40m
                  40m