boostorg / boostorg/asio

C4242 warning at line 511 in serial_port_base.ipp

Offen
#392 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
1.6k
Forks
485
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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(value_);`

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.