[PATCH] w32: Fix clang compiler error with function pointer

Biswapriyo Nath nathbappai at gmail.com
Wed May 31 06:19:52 CEST 2023


> Is "allow_set_forground" intended or a typo for "allow_set_foreground"?

Yes, I didn't notice it.

> Also, this looks like a clang bug:  both version of the code should
> declare a function pointer of the same type.

I do not think so. gcc also shows a compiler warning with that line as
following.

../../src/gpgme-w32spawn.c:253:20: warning: assignment to 'BOOL
(*)(DWORD)' {aka 'int (*)(long unsigned int)'} from incompatible
pointer type 'FARPROC' {aka 'long long
int (*)()'} [-Wincompatible-pointer-types]
  253 |               func = GetProcAddress (handle,
"AllowSetForegroundWindow");
      |                    ^

clang only treats it as a compiler error by default.



More information about the Gnupg-devel mailing list