[cfe-dev] g++ test net20.c generates wrong code

Dmitri Gribenko gribozavr at gmail.com
Wed Feb 27 05:48:17 PST 2013


On Wed, Feb 27, 2013 at 11:05 AM, Pankaj Gode <godepankaj at yahoo.com> wrote:
> Is clang not recognizing this correctly or am I making any mistake ?

Clang is correct.  The function is returning a pointer to a member.
You can check with 'cdecl' when you are unsure what a declaration
means:

$ cdecl -+
Type `help' or `?' for help
cdecl> explain void (X::* fee ())()
declare fee as function returning pointer to member of class X
function returning void
cdecl>

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-dev mailing list