[llvm] f42f551 - [llvm] Silence warning when compiling with MSVC targetting x86
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 06:34:37 PST 2024
Author: Alexandre Ganea
Date: 2024-01-25T09:34:18-05:00
New Revision: f42f551d12466c5f17f91cb44592e8dcb4118f07
URL: https://github.com/llvm/llvm-project/commit/f42f551d12466c5f17f91cb44592e8dcb4118f07
DIFF: https://github.com/llvm/llvm-project/commit/f42f551d12466c5f17f91cb44592e8dcb4118f07.diff
LOG: [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
```
Added:
Modified:
llvm/lib/ObjectYAML/COFFYAML.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ObjectYAML/COFFYAML.cpp b/llvm/lib/ObjectYAML/COFFYAML.cpp
index cd1db24f0d5d132..e14e1b5e467b41c 100644
--- a/llvm/lib/ObjectYAML/COFFYAML.cpp
+++ b/llvm/lib/ObjectYAML/COFFYAML.cpp
@@ -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)
+ ptr
diff _t dist =
+ reinterpret_cast<char *>(&Member) - reinterpret_cast<char *>(&LoadConfig);
+ if (dist < (ptr
diff _t)LoadConfig.Size)
IO.mapOptional(Name, Member);
}
More information about the llvm-commits
mailing list