From: SourceForge.net <no...@so...> - 2004-07-06 08:33:57
|
Bugs item #985752, was opened at 2004-07-06 18:37 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=985752&group_id=2435 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Alexandr Zamaraev (shura_zam) Assigned to: Nobody/Anonymous (nobody) Summary: function pointer calling conversion problem Initial Comment: If i declare function pointer as: typedef ret_type (__stdcall *func_t)(args); Some assigment generate error "invalid conversion". But If i declare function pointer as: typedef ret_type (* __stdcall func_t)(args); Other some assigment generate error "invalid conversion". What mast i declare function pointer ? My system information: Os WinXP gcc version 3.3.1 (mingw special 20030804-1) GNU ld version 2.13.90 20030111 MinGW-3.1.0-1.exe __MINGW32_VERSION 3.1 __W32API_VERSION 2.5 Command line for show bug: >g++ -Wall -c -pipe PluginBMP.cpp ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2004-07-06 20:33 Message: Logged In: YES user_id=11494 Like this (which is actually a testcase in gcc sources): extern int * (__attribute__((stdcall)) *fooPtr)( void); int * __attribute__((stdcall)) myFn01( void) { return 0; } void snafu( void) { fooPtr = myFn01; } There were problems in 3.3.1 with return types that were pointers. The workaround was to enclose the return value in (), like typedef (void *) (DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read); That bug is fixed in gcc now. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=985752&group_id=2435 |