KalleOlaviNiemitalo commented on code in PR #3056:
URL: https://github.com/apache/avro/pull/3056#discussion_r1702666568
##########
lang/c++/impl/DataFile.cc:
##########
@@ -63,35 +64,34 @@ boost::iostreams::zlib_params get_zlib_params() {
}
} // namespace
-DataFileWriterBase::DataFileWriterBase(const char *filename, const ValidSchema
&schema, size_t syncInterval,
- Codec codec) : filename_(filename),
- schema_(schema),
+DataFileWriterBase::DataFileWriterBase(const char *filename,
+ const ValidSchema &schema,
+ size_t syncInterval,
+ Codec codec) :
DataFileWriterBase(fileOutputStream(filename), schema, syncInterval, codec) {
+}
+
+DataFileWriterBase::DataFileWriterBase(OutputStream &outputStream,
Review Comment:
There is apparently
[`[[clang::lifetimebound]]`](https://clang.llvm.org/docs/AttributeReference.html#lifetimebound)
for marking parameters like that, to let static analysis warn if the lifetime
of the referenced object ends too early.
It might be useful to add such attributes in a follow-up pull request. Not
only in this constructor but also in any other functions that have similar
risks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]