[ 
https://issues.apache.org/jira/browse/AVRO-3942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821025#comment-17821025
 ] 

ASF subversion and git services commented on AVRO-3942:
-------------------------------------------------------

Commit 258571ba84d2e0317b45ac95c1a974e0ee7e7725 in avro's branch 
refs/heads/dependabot/cargo/lang/rust/env_logger-0.11.2 from Mikhail Koviazin
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=258571ba8 ]

[AVRO-3942] Mark MemoryOutputStream as final (#2752)

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 {
      |       ^

> MemoryOutputStream yields a compiler warning
> --------------------------------------------
>
>                 Key: AVRO-3942
>                 URL: https://issues.apache.org/jira/browse/AVRO-3942
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: c++
>            Reporter: Mikhail Koviazin
>            Assignee: Mikhail Koviazin
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.12.0, 1.11.4
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Upon building with clang, MemoryOutputStream raises a compilation warning:
>  
>  
> {code:java}
> /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 {
>       |       ^
>  
> {code}
>  
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to