Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

C4242 warning at line 511 in serial_port_base.ipp #392

Open
trekkie34 opened this issue Jun 28, 2022 · 0 comments
Open

C4242 warning at line 511 in serial_port_base.ipp #392

trekkie34 opened this issue Jun 28, 2022 · 0 comments

Comments

@trekkie34
Copy link

File asio\impl\serial_port_base.ipp generates warning C4242 at line 511 due to conversion between unsigned int and BYTE. I have observed this when compiling with Visual Studio 2019 in an MFC project.

the original line:
storage.ByteSize = value_;

the addition of a static cast fixes the issue in my local copy of the source code.
storage.ByteSize = static_cast<BYTE>(value_);

Strictly speaking there is no run time bug, however this issue is troublesome for developers treating warnings as errors.

@mclow mclow transferred this issue from boostorg/boost Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant