Skip to content

[C++] Cast memcpy argument to size_t #730

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

trozen
Copy link
Contributor

@trozen trozen commented Oct 15, 2019

memcpy is expecting a size_t argument, 32-bit builds fail with the following message:

error: conversion to ‘size_t {aka unsigned int}’ from ‘uint64_t {aka long long unsigned int}’ may alter its value [-Werror=conversion]

Adding explicit cast to silence these errors/warnings.

(IMO it would be better to use size_t where byte arrays and offsets are referenced. However this would change the public interface, so didn't want to to this as part of this PR.)

@mjpt777 mjpt777 merged commit 353b6c5 into aeron-io:master Oct 15, 2019
@trozen trozen deleted the memcpy-sizet-cast branch October 15, 2019 11:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants