-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
QE 2022-02-21
The C++ standard says the following about unsigned->signed conversions:
"If the destination type is signed, the value is unchanged if it can be represented in the destination type (and bit-field width); otherwise, the value is implementation-defined."
The goal of this task is to audit how bitcastTo() and bitcastFrom() convert from unsigned to signed, and to fix these functions as needed so that the convert from unsigned to signed in a manner that preserves the bit pattern (i.e. it should match how memcpy() would perform the conversion).
It would also be good to scrutinize any signed to unsigned conversions performed within the implementations of bitcastTo() and bitcastFrom() and to make sure we're happy with how we're performing these conversions.