MISRA , / , , . . typecast ( ++ _cast) , - , - , undefined.
, undefined , . MISRA , ... , , , , .
, MISRA , , , undefined ( ..) " ", .
file.read() () info.
if (file.read((char_t*)&info, (int32_t)sizeof(INFO)).gcount() != (int32_t)sizeof(INFO)
{
LOG("ERROR: Couldn't read the file info header\n");
res = GENERAL_FAILURE;
}
, , , MISRA. -
std::streamsize size_to_read = whatever();
std::vector<char> buffer(size_to_read);
if (file.read(&buffer[0], size_to_read) == size_to_read)
{
}
else
{
LOG("ERROR: Couldn't read the file info header\n");
res = GENERAL_FAILURE;
}
, , , , . . MISRA, , , , , . ( , sizeof), - A - , , B. MISRA - , , .
. char_t * std::istream::read() int32_t . . char * std::streamsize ( , int32_t).