martin-g commented on code in PR #3740:
URL: https://github.com/apache/avro/pull/3740#discussion_r3133710702


##########
lang/c++/include/avro/buffer/detail/BufferDetail.hh:
##########
@@ -320,7 +320,7 @@ public:
         if (freeSpace_ && (sizeof(T) <= writeChunks_.front().freeSize())) {
             // fast path, there's enough room in the writeable chunk to just
             // straight out copy it
-            *(reinterpret_cast<T *>(writeChunks_.front().tellWritePos())) = 
val;
+            memcpy(writeChunks_.front().tellWritePos(), &val, sizeof(T));

Review Comment:
   > It doesn't appear to be necessary, and memcpy is already used here, but I 
can add `#include <cstring>` if you'd like.
   
   Please add it! Someone has forgotten to do it before.



-- 
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]

Reply via email to