diff --git a/flang-rt/include/flang-rt/runtime/emit-encoded.h b/flang-rt/include/flang-rt/runtime/emit-encoded.h index d99f56b29558..ea83901fcc8b 100644 --- a/flang-rt/include/flang-rt/runtime/emit-encoded.h +++ b/flang-rt/include/flang-rt/runtime/emit-encoded.h @@ -64,7 +64,7 @@ RT_API_ATTRS bool EmitEncoded( } else { // CHARACTER kind conversion for internal output while (chars-- > 0) { - char32_t buffer = *data++; + char32_t buffer = static_cast(*data++); char *p{reinterpret_cast(&buffer)}; if constexpr (!isHostLittleEndian) { p += sizeof(buffer) - internalKind; diff --git a/flang-rt/lib/runtime/edit-input.cpp b/flang-rt/lib/runtime/edit-input.cpp index 68ea34bf63cc..0cc287aa3b47 100644 --- a/flang-rt/lib/runtime/edit-input.cpp +++ b/flang-rt/lib/runtime/edit-input.cpp @@ -983,7 +983,7 @@ static RT_API_ATTRS bool EditDelimitedCharacterInput( } } if (length > 0) { - *x++ = *ch; + *x++ = static_cast(*ch); --length; } } @@ -1030,7 +1030,7 @@ static RT_API_ATTRS bool EditListDirectedCharacterInput( break; } if (length > 0) { - *x++ = *ch; + *x++ = static_cast(*ch); --length; } else if (edit.IsNamelist()) { // GNU compatibility @@ -1111,7 +1111,7 @@ RT_API_ATTRS bool EditCharacterInput(IoStatementState &io, const DataEdit &edit, (sizeof *x == 2 && *ucs > 0xffff)) { *x++ = '?'; } else { - *x++ = *ucs; + *x++ = static_cast(*ucs); } --lengthChars; } else if (chunkBytes == 0) { @@ -1130,7 +1130,7 @@ RT_API_ATTRS bool EditCharacterInput(IoStatementState &io, const DataEdit &edit, (sizeof *x == 2 && buffer > 0xffff)) { *x++ = '?'; } else { - *x++ = buffer; + *x++ = static_cast(buffer); } --lengthChars; }