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

ASF GitHub Bot commented on PARQUET-1267:
-----------------------------------------

rip-nsk commented on issue #451: PARQUET-1267: [C++] replace "unsafe" 
std::equal by std::memcmp
URL: https://github.com/apache/parquet-cpp/pull/451#issuecomment-379624958
 
 
   std::memcmp is not safer, it just requires the same size arguments.
   std::equal has (implicitly) the same requirements, but since c++14 
introduces a more secure version, this one is marked as deprecate.
   Both variants are valid (since we check size of arrays first).
   Anyway, memcmp is more suitable here - we're comparing byte (not object) 
arrays, code for FLBA uses it also - 
https://github.com/apache/parquet-cpp/search?utf8=%E2%9C%93&q=memcmp&type=

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> replace "unsafe" std::equal by std::memcmp
> ------------------------------------------
>
>                 Key: PARQUET-1267
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1267
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-cpp
>            Reporter: rip.nsk
>            Priority: Trivial
>
> std::equal(first1, last1, first2, size) is considered unsafe by msvc, replace 
> it by std::memcmp



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to