From: SourceForge.net <no...@so...> - 2007-07-13 17:24:00
|
Bugs item #1678803, was opened at 2007-03-12 10:07 Message generated for change (Comment added) made by rlar You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1678803&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ralf Guetlein (rguetlein) Assigned to: Nobody/Anonymous (nobody) Summary: __naked functions that return function pointers Initial Comment: typedef void (*func)(void); func GetFunc(void) __naked { _asm ; some assembler code _endasm; } void Caller(void) { GetFunc()(); } The above mentioned program leads to the error message "error 12: called object is not a function". Some tests indicated that the __naked modifier confuses the compiler about the return value of GetFunc(). If I change Getfunc() to not use __naked it compiles OK: func GetFunc(void) { return (func)0; } I tested this with 2.6.0 and the latest snapshot. ---------------------------------------------------------------------- Comment By: rlar (rlar) Date: 2007-07-13 19:23 Message: Logged In: YES user_id=1840151 Originator: NO Ralf Guetlein, i've tried svn version #4870 and #4882 with sdcc -c -mmcs51 and "ret" for "some assembler code" both versions worked well. what version did you try ? what was the exact command line for sdcc ? Robert Larice ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1678803&group_id=599 |