[compiler-rt] [compiler-rt] Work around incompatible Windows definitions of (S)SIZE_T (PR #106311)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 02:07:53 PDT 2024
https://github.com/mstorsjo requested changes to this pull request.
Unfortunately, this doesn't work.
>From the mingw build:
```
In file included from /home/martin/code/llvm-mingw/llvm-project/compiler-rt/lib/interception/interception_win.cpp:132:
In file included from /home/martin/clang-trunk/i686-w64-mingw32/include/windows.h:69:
In file included from /home/martin/clang-trunk/i686-w64-mingw32/include/windef.h:9:
In file included from /home/martin/clang-trunk/i686-w64-mingw32/include/minwindef.h:163:
In file included from /home/martin/clang-trunk/i686-w64-mingw32/include/winnt.h:150:
/home/martin/clang-trunk/i686-w64-mingw32/include/basetsd.h:147:39: error: typedef declarator cannot be qualified
147 | __MINGW_EXTENSION typedef ULONG_PTR SIZE_T,*PSIZE_T;
| ^~~~~~
/home/martin/code/llvm-mingw/llvm-project/compiler-rt/lib/interception/interception.h:34:29: note: expanded from macro 'SIZE_T'
34 | #define SIZE_T __sanitizer::usize
| ~~~~~~~~~~~~~^
```
>From the MSVC build:
```
C:\code\llvm-project\compiler-rt\lib\asan\asan_win.cpp(195): error C2665: '__interception::OverrideFunction': no overloaded function could convert all the argument types
C:\code\llvm-project\compiler-rt\lib\interception\interception_win.h(31): note: could be 'bool __interception::OverrideFunction(const char *,__interception::uptr,__interception::uptr *)'
C:\code\llvm-project\compiler-rt\lib\asan\asan_win.cpp(195): note: 'bool __interception::OverrideFunction(const char *,__interception::uptr,__interception::uptr *)': cannot convert argument 3 from '__sanitizer::uptr *' to '__interception::uptr *'
C:\code\llvm-project\compiler-rt\lib\asan\asan_win.cpp(197): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\code\llvm-project\compiler-rt\lib\interception\interception_win.h(28): note: or 'bool __interception::OverrideFunction(__interception::uptr,__interception::uptr,__interception::uptr *)'
C:\code\llvm-project\compiler-rt\lib\asan\asan_win.cpp(195): note: 'bool __interception::OverrideFunction(__interception::uptr,__interception::uptr,__interception::uptr *)': cannot convert argument 1 from 'const char [15]' to '__interception::uptr'
C:\code\llvm-project\compiler-rt\lib\asan\asan_win.cpp(195): note: There is no context in which this conversion is possible
C:\code\llvm-project\compiler-rt\lib\asan\asan_win.cpp(195): note: while trying to match the argument list '(const char [15], __sanitizer::uptr, __sanitizer::uptr *)'
```
https://github.com/llvm/llvm-project/pull/106311
More information about the llvm-commits
mailing list