- src/gpgme-w32spawn.c: Change func signature to FARPROC --
 
GetProcAddress is documented as returning a FARPROC. Assigning it to a
BOOL (WINAPI * )(DWORD) won't compile with -Wincompatible-pointer-types
 Differential  D602  
Fix assignment of GetProcAddress to func Authored by CarlSchwan on Jun 6 2024, 4:36 PM. Tags None Subscribers None 
Details 
 
 GetProcAddress is documented as returning a FARPROC. Assigning it to a Compiles 
Diff Detail 
 Event TimelineComment Actions The compile error: ../../gpgme-1.24.0-beta566/src/gpgme-w32spawn.c:252:20: error: assignment to 'BOOL (*)(DWORD)' {aka 'int (*)(long unsigned int)'} from incompatible pointer type 'FARPROC' {aka 'long long int (*)()'} [-Wincompatible-pointer-types]
  252 |               func = GetProcAddress (handle, "AllowSetForegroundWindow")Comment Actions I think the correct fix is to C-cast the return value of GetProcAddress to the type of func which we would have to define with a typedef as in the example for GetProcAddress: https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress Comment Actions Our Makefile does not use -Wincompatible-pointer-types for a reason. Please build gpgme only the standard way, i.e. by using ./autogen.sh --build-w32. Keep in mind that C is an entire different language than C++.  |