1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[MachOYAML] Use a temporary to avoid gcc strict-aliasing warning

GCC complains about this with -Wstrict-aliasing. Using a temporary here should prevent the warning.

llvm-svn: 273627
This commit is contained in:
Chris Bieneman 2016-06-23 23:01:47 +00:00
parent 411e5da487
commit 628114a47f

View File

@ -182,8 +182,10 @@ void mapLoadCommandData<MachO::dylinker_command>(
void MappingTraits<MachOYAML::LoadCommand>::mapping(
IO &IO, MachOYAML::LoadCommand &LoadCommand) {
IO.mapRequired(
"cmd", (MachO::LoadCommandType &)LoadCommand.Data.load_command_data.cmd);
MachO::LoadCommandType TempCmd = static_cast<MachO::LoadCommandType>(
LoadCommand.Data.load_command_data.cmd);
IO.mapRequired("cmd", TempCmd);
LoadCommand.Data.load_command_data.cmd = TempCmd;
IO.mapRequired("cmdsize", LoadCommand.Data.load_command_data.cmdsize);
#define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) \