Re: [Mingw-w64-public] wspiapi.h:50:20: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(struct addrinfo *)’ to ‘int (__attribute__((stdcall)) *)()’ [-Wcast-f

2024-08-05 Thread Hannes Domani via Mingw-w64-public
Am Montag, 5. August 2024 um 17:54:53 MESZ hat Pali Rohár Folgendes geschrieben: > On Monday 05 August 2024 23:04:21 LIU Hao wrote: > > 在 2024-08-05 20:14, Antonin Décimo 写道: > > > C99 in Annex J.5.7 Function pointer casts states: > > > 1 A pointer to an object or to void may be cast to a point

Re: [Mingw-w64-public] wspiapi.h:50:20: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(struct addrinfo *)’ to ‘int (__attribute__((stdcall)) *)()’ [-Wcast-f

2024-08-05 Thread Pali Rohár
On Monday 05 August 2024 23:04:21 LIU Hao wrote: > 在 2024-08-05 20:14, Antonin Décimo 写道: > > C99 in Annex J.5.7 Function pointer casts states: > > 1 A pointer to an object or to void may be cast to a pointer to a > > function, allowing data to be invoked as a function (6.5.4). > > 2 A pointer to a

Re: [Mingw-w64-public] wspiapi.h:50:20: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(struct addrinfo *)’ to ‘int (__attribute__((stdcall)) *)()’ [-Wcast-f

2024-08-05 Thread LIU Hao
在 2024-08-05 20:14, Antonin Décimo 写道: C99 in Annex J.5.7 Function pointer casts states: 1 A pointer to an object or to void may be cast to a pointer to a function, allowing data to be invoked as a function (6.5.4). 2 A pointer to a function may be cast to a pointer to an object or to void, allow

Re: [Mingw-w64-public] profile/profil.c:140:36: warning: cast between incompatible function types

2024-08-05 Thread LIU Hao
在 2024-08-05 18:17, Pali Rohár 写道: Ok, would you apply it? Or do you need from my some other steps? Please send a standalone patch instead. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature ___ Mingw-w64-public

Re: [Mingw-w64-public] wspiapi.h:50:20: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(struct addrinfo *)’ to ‘int (__attribute__((stdcall)) *)()’ [-Wcast-f

2024-08-05 Thread Antonin Décimo
Le lun. 5 août 2024 à 11:27, LIU Hao a écrit : > > 在 2024-08-05 01:40, Pali Rohár 写道: > > It looks like that casting whole function pointer to LPVOID type prior > > casting to FARPROC mutes this warning. > > > > Now I remember that in past I have already used casting return value > > from GetProcA

Re: [Mingw-w64-public] intrin-impl.h compile warning: this use of "defined" may not be portable

2024-08-05 Thread Pali Rohár
On Monday 05 August 2024 16:54:14 LIU Hao wrote: > 在 2024-08-05 01:59, Pali Rohár 写道: > > I looked at the definition of that __INTRINSIC_PROLOG macro but I have > > absolutely no idea what is the problem there. > > > > Can we mute somehow this warning? > > It's because the C standard requires tha

Re: [Mingw-w64-public] profile/profil.c:140:36: warning: cast between incompatible function types

2024-08-05 Thread Pali Rohár
On Monday 05 August 2024 17:23:24 LIU Hao wrote: > 在 2024-08-05 01:18, Pali Rohár 写道: > > "Do not declare this callback function with a void return type and cast > > the function pointer to LPTHREAD_START_ROUTINE when creating the thread. > > Code that does this is common, but it can crash on 64-bi

Re: [Mingw-w64-public] wspiapi.h:50:20: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(struct addrinfo *)’ to ‘int (__attribute__((stdcall)) *)()’ [-Wcast-

2024-08-05 Thread Pali Rohár
On Monday 05 August 2024 17:26:47 LIU Hao wrote: > 在 2024-08-05 01:40, Pali Rohár 写道: > > It looks like that casting whole function pointer to LPVOID type prior > > casting to FARPROC mutes this warning. > > > > Now I remember that in past I have already used casting return value > > from GetProcA

Re: [Mingw-w64-public] wspiapi.h:50:20: warning: cast between incompatible function types from ‘void (__attribute__((stdcall)) *)(struct addrinfo *)’ to ‘int (__attribute__((stdcall)) *)()’ [-Wcast-f

2024-08-05 Thread LIU Hao
在 2024-08-05 01:40, Pali Rohár 写道: It looks like that casting whole function pointer to LPVOID type prior casting to FARPROC mutes this warning. Now I remember that in past I have already used casting return value from GetProcAddress() to LPVOID and after that to the correct function pointer typ

Re: [Mingw-w64-public] profile/profil.c:140:36: warning: cast between incompatible function types

2024-08-05 Thread LIU Hao
在 2024-08-05 01:18, Pali Rohár 写道: "Do not declare this callback function with a void return type and cast the function pointer to LPTHREAD_START_ROUTINE when creating the thread. Code that does this is common, but it can crash on 64-bit Windows." That probably applies exclusively to Itanium, w

Re: [Mingw-w64-public] stdio/_scprintf.c:32:20: warning: ‘init_scprintf’ used but never defined

2024-08-05 Thread LIU Hao
在 2024-08-05 00:44, Pali Rohár 写道: _init_scprintf: ... .def__vscprintf;.scl2; .type 32; .endef .def_init_scprintf; .scl2; .type 32; .endef It is correct that _init_scprintf has two ".def" lines? Probably not... If it is declared elsewhe

Re: [Mingw-w64-public] intrin-impl.h compile warning: this use of "defined" may not be portable

2024-08-05 Thread LIU Hao
在 2024-08-05 01:59, Pali Rohár 写道: I looked at the definition of that __INTRINSIC_PROLOG macro but I have absolutely no idea what is the problem there. Can we mute somehow this warning? It's because the C standard requires that invocation of `defined` must appear directly in a condition, and