[compiler-rt] [compiler-rt] Fix definition of `uptr` (and `usize`) on 32-bit Windows (PR #106151)
Alexander Richardson via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 27 09:40:16 PDT 2024
arichardson wrote:
I see the following in godbolt showing that size_t is unsigned int:
```
# 37 "//172.30.0.254/winshared/compilers/mingw-w64-13.1.0-16.0.2-11.0.0-ucrt-r1/x86_64-w64-mingw32/include/corecrt.h" 3 4
typedef unsigned int size_t;
# 47 "//172.30.0.254/winshared/compilers/mingw-w64-13.1.0-16.0.2-11.0.0-ucrt-r1/x86_64-w64-mingw32/include/corecrt.h" 3 4
typedef int ssize_t;
```
However, as you note above SIZE_T and SSIZE_T don't follow this:
```
__extension__ typedef ULONG_PTR SIZE_T,*PSIZE_T;
__extension__ typedef LONG_PTR SSIZE_T,*PSSIZE_T;
```
So the real problem is that the interceptors definition of SIZE_T (to avoid conflicting with the real size_t) happens to trample on the Windows headers existing definitions (I don't believe this type exists on Linux/FreeBSD). This dates back to 2012 (https://github.com/llvm/llvm-project/commit/07bb3925b019869b4e00dcee2070a5bbc5639b77) and I'm not quite sure how to fix it best - I'll make this a minimal change to unbreak windows and will update https://github.com/llvm/llvm-project/pull/106155 to try and properly fix this.
https://github.com/llvm/llvm-project/pull/106151
More information about the llvm-commits
mailing list