You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datasketches.apache.org by "Jon Malkin (Jira)" <ji...@apache.org> on 2020/07/21 19:08:00 UTC

[jira] [Commented] (DATASKETCHES-9) Remove c-style const casts in kll/ and common/ directories

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

Jon Malkin commented on DATASKETCHES-9:
---------------------------------------

(Sorry, focus wasn't in the text box so apparently I inadvertently assigned to myself while starting to reply.)

We've been using github issues to track repo-specific tasks, preferring to leave Jira for cross-repo issues. Can you please create it here? [https://github.com/apache/incubator-datasketches-cpp/issues]

> Remove c-style const casts in kll/ and common/ directories
> ----------------------------------------------------------
>
>                 Key: DATASKETCHES-9
>                 URL: https://issues.apache.org/jira/browse/DATASKETCHES-9
>             Project: Apache Datasketches
>          Issue Type: Improvement
>            Reporter: Gabor Kaszab
>            Priority: Major
>
> I recently started integrating the Apache DataSketches C++ library into Apache Impala and our build system (with clang tidy) found some casts where the const-ness is casted away using c-style casts. The best practice would be to use C++ style casts like const_cast in this case instead.
> The code popping up in the report:
> 1)
> https://github.com/apache/incubator-datasketches-cpp/blob/762904bb168d44846c1fe4f178998c9a8a57ccba/common/include/serde.hpp#L53
> This can be a reinterpret_cast<char*>(const_cast<T*>(items))
> 2)
> https://github.com/apache/incubator-datasketches-cpp/blob/762904bb168d44846c1fe4f178998c9a8a57ccba/kll/include/kll_sketch_impl.hpp#L381
> Note, fixing this will result that 2 lines below will pop up in the report, fixing that will reveal the same error another 2 lines below, and so on.
> This ticket focuses only on the kll/ and common/ folders of the C++ library as my work was only touching those folders so I've only run the report on them.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org