You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Bannier (JIRA)" <ji...@apache.org> on 2015/11/25 16:45:10 UTC

[jira] [Updated] (MESOS-3795) process::io::write takes parameter as void* which could be const

     [ https://issues.apache.org/jira/browse/MESOS-3795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bannier updated MESOS-3795:
------------------------------------
    Attachment:     (was: ubuntu14_clang-3.6_FAILED.log)

> process::io::write takes parameter as void* which could be const
> ----------------------------------------------------------------
>
>                 Key: MESOS-3795
>                 URL: https://issues.apache.org/jira/browse/MESOS-3795
>             Project: Mesos
>          Issue Type: Improvement
>          Components: libprocess
>            Reporter: Benjamin Bannier
>              Labels: mesosphere, tech-debt
>
> In libprocess we have
> {code}
> Future<size_t> write(int fd, void* data, size_t size);
> {code}
> which expects a non-{{const}} {{void*}} for its {{data}} parameter. Under the covers {{data}} appears to be handled as a {{const}} (like one would expect from the signature its inspiration {{::write}}).
> This function is not used too often, but since it expects a non-{{const}} value for {{data}} automatic conversions to {{void*}} from other pointer types are disabled; instead callers seem cast manually to {{void*}} -- often with C-style casts.
> We should sync this method's signature with that of {{::write}}.
> In addition to following the expected semantics of {{::write}}, having this work without casts with any pointer value {{data}} would make it easier to interface this with character literals, or raw data ptrs from STL containers (e.g. {{Container::data}}). It would probably also indirectly eliminate temptation to use C-casts.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)