[clang] Split -Wcast-function-type into a separate group (PR #86131)

2025-04-15 Thread Peter Dimov via cfe-commits
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

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2025-04-15 Thread Peter Dimov via cfe-commits
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

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2025-04-14 Thread Peter Dimov via 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

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2025-04-14 Thread Peter Dimov via cfe-commits
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

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2025-04-14 Thread Peter Dimov via cfe-commits
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