Skip to content

Commit

Permalink
[llvm] Silence warning when compiling with MSVC targetting x86
Browse files Browse the repository at this point in the history
This fixes:
```
[1304/6998] Building CXX object lib\ObjectYAML\CMakeFiles\LLVMObjectYAML.dir\COFFYAML.cpp.obj
C:\git\llvm-project\llvm\lib\ObjectYAML\COFFYAML.cpp(561): warning C4018: '<': signed/unsigned mismatch
```
  • Loading branch information
aganea committed Jan 25, 2024
1 parent 3db3e2c commit f42f551
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/ObjectYAML/COFFYAML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,9 @@ void MappingTraits<object::coff_load_config_code_integrity>::mapping(
template <typename T, typename M>
void mapLoadConfigMember(IO &IO, T &LoadConfig, const char *Name, M &Member) {
// Map only members that match a specified size.
if (reinterpret_cast<char *>(&Member) -
reinterpret_cast<char *>(&LoadConfig) <
LoadConfig.Size)
ptrdiff_t dist =
reinterpret_cast<char *>(&Member) - reinterpret_cast<char *>(&LoadConfig);
if (dist < (ptrdiff_t)LoadConfig.Size)
IO.mapOptional(Name, Member);
}

Expand Down

0 comments on commit f42f551

Please sign in to comment.