Skip to content

Commit

Permalink
[AVRO-3942] Mark MemoryOutputStream as final (#2752)
Browse files Browse the repository at this point in the history
Otherwise the class raises a compilation warning:

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 {
      |                           ^
lang/c++/impl/Stream.cc:120:7: note: mark 'avro::MemoryOutputStream' as 'final' to silence this warning
  120 | class MemoryOutputStream : public OutputStream {
      |       ^
  • Loading branch information
mkmkme authored Feb 20, 2024
1 parent 85b8623 commit 258571b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lang/c++/impl/Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class MemoryInputStream2 : public InputStream {
}
};

class MemoryOutputStream : public OutputStream {
class MemoryOutputStream final : public OutputStream {
public:
const size_t chunkSize_;
std::vector<uint8_t *> data_;
Expand Down

0 comments on commit 258571b

Please sign in to comment.