float __stdcall (*pFunc)(float a, float b) = (float (__stdcall *)(float,float))0x411280;
How to declare a function pointer with calling convention? The
int (__cdecl **func)()
is the most accepted form by compilers. Some compilers accept int __cdecl (**func)(int)
and int (**__cdecl func)(int)
or even int (*__cdecl *func)(int)
. Clang accepts all 3 forms and correctly interprets them as the type int ((**))(int) __attribute__((cdecl))
Introducing a const
pointer on clang also does not change the picture and any arrangement is accepted so long as const is after the pointer
const int __cdecl (*const func)();
const int (__cdecl *const func)();
const int (*const __cdecl func)();