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

Pankaj Gode godepankaj at yahoo.com
Wed Feb 27 06:11:50 PST 2013


Thanks a lot. 
This information was very helpful.
 
Regards,
Pankaj
 


________________________________
From: Dmitri Gribenko <gribozavr at gmail.com>
To: Pankaj Gode <godepankaj at yahoo.com> 
Cc: "cfe-dev at cs.uiuc.edu" <cfe-dev at cs.uiuc.edu> 
Sent: Wednesday, February 27, 2013 7:18 PM
Subject: Re: [cfe-dev] g++ test net20.c generates wrong code

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>*/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130227/284ff9fc/attachment.html>


More information about the cfe-dev mailing list