Skip to content

Commit f42f551

Browse files
committed
[llvm] Silence warning when compiling with MSVC targetting x86
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 ```
1 parent 3db3e2c commit f42f551

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/ObjectYAML/COFFYAML.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ void MappingTraits<object::coff_load_config_code_integrity>::mapping(
557557
template <typename T, typename M>
558558
void mapLoadConfigMember(IO &IO, T &LoadConfig, const char *Name, M &Member) {
559559
// Map only members that match a specified size.
560-
if (reinterpret_cast<char *>(&Member) -
561-
reinterpret_cast<char *>(&LoadConfig) <
562-
LoadConfig.Size)
560+
ptrdiff_t dist =
561+
reinterpret_cast<char *>(&Member) - reinterpret_cast<char *>(&LoadConfig);
562+
if (dist < (ptrdiff_t)LoadConfig.Size)
563563
IO.mapOptional(Name, Member);
564564
}
565565

0 commit comments

Comments
 (0)