You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2011/05/18 12:42:39 UTC

const improperly cast away

[[[
svn_fs_fs__dag_deserialize(const char *data)
{
  dag_node_t *node = (dag_node_t *)data;
  svn_fs_fs__id_deserialize(node,
                            (svn_fs_id_t **)&node->fresh_root_predecessor_id);
}
]]]

Here, the 'fresh_root_predecessor_id' member of '*node' is somewhere
within *data, and therefore const.

I guess that one of the APIs here should get the 'const' removed from
its signature?

Re: const improperly cast away

Posted by Stefan Fuhrmann <st...@alice-dsl.de>.
On 18.05.2011 12:42, Daniel Shahaf wrote:
> [[[
> svn_fs_fs__dag_deserialize(const char *data)
> {
>    dag_node_t *node = (dag_node_t *)data;
>    svn_fs_fs__id_deserialize(node,
>                              (svn_fs_id_t **)&node->fresh_root_predecessor_id);
> }
> ]]]
>
> Here, the 'fresh_root_predecessor_id' member of '*node' is somewhere
> within *data, and therefore const.
>
> I guess that one of the APIs here should get the 'const' removed from
> its signature?
>
Done in r1124255.

-- Stefan^2.