pdimov wrote:
The above was a 64 bit build, in 32 bit the warning is
```
1>testbed2022.cpp(8,15): warning : cast from 'FARPROC' (aka 'int (*)()
__attribute__((stdcall))') to 'PGNSI' (aka 'void (*)(_SYSTEM_INFO *)
__attribute__((stdcall))') converts to incompatible function type
[-Wcast-functio
pdimov wrote:
Yes please. :-) And thanks very much.
https://github.com/llvm/llvm-project/pull/86131
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
pdimov wrote:
I get the warning for your code.
```
1>testbed2022.cpp(8,15): warning : cast from 'FARPROC' (aka 'long long (*)()')
to 'PGNSI' (aka 'void (*)(_SYSTEM_INFO *)') converts to incompatible function
type [-Wcast-function-type-mismatch]
```
Make sure you're passing /W4 to clang-cl.
htt
pdimov wrote:
Since you aren't diagnosing reinterpret-casting a function pointer from
`void*`, because this would warn on idiomatic POSIX code (`dlsym` returns
`void*`), it seemed to me that you'd be interested in not warning on idiomatic
Windows code (`GetProcAddress` returns `FARPROC`.)
But
pdimov wrote:
This warning creates issues under Windows, where reinterpret-casting from
FARPROC to the actual function type is common.
https://github.com/llvm/llvm-project/pull/92738
https://github.com/boostorg/interprocess/issues/259
Reinterpret-casting a function pointer to another function